摘要:Encrypting Data With the SQL Server Encrypt Function A common question I'm asked by clients is how to encrypt data and store it in SQL Server. One of the major problems I see in the field is when peop...
阅读全文
06 2005 档案
摘要:-- This script converts string-based IP addresses to their numericequivalents so that it is easy to do arithmatic on them such as find anIP address that is within a range.-- -- NOTE: This function cal...
阅读全文
摘要:-- ----exec Up_ExportTables 'Customers'-- When you want to export a table structure to T-SQL, everyone alwayspoints you to Enterprise Manager, or a script that calls BCP.-- Sometimes, a developer eith...
阅读全文
摘要:CREATE TABLE [dbo].[DateDim] ( [DateKey] [int] IDENTITY (1, 1) NOT NULL , [ActualDate] [datetime] NOT NULL , [Year] [int] NOT NULL , [Quarter] [int] NOT NULL , [Month] [int] NOT NULL , [Week] [int] NO...
阅读全文
摘要:SET NOCOUNT ONGOuse pubs; --EXEC sp_generate_inserts 'David01' ,@from="from David01 where A='a1'"PRINT 'Using Master database'USE masterGOPRINT 'Checking for the existence of this procedure'IF (SELE...
阅读全文
摘要:/* ***** This entire comment portion is not necessarily part of SP, just notes on subject ***** The purpose of this SP is to provide a method in T-SQL to launch another T-SQL thread without havin...
阅读全文
摘要:Don't Use Select * Something you see in a lot of database access code is a select statement that looks something like this: SELECT * FROM TableName WHERE ... While there's technicall...
阅读全文
摘要:Sql Server数据库被置疑后解决方法 现象:数据库Log日志太大了,shrink不掉。于是想把数据库文件卸下来,删除log,再附加上。附加失败。 提示错误: 服务器: 消息 1813,级别 16,状态 2,行 1 未能打开新数据库 'metadb'。CREATE DATABASE 将终止。 设备激活错误。物理文件名 'd:\metadb.LDF' 可能有误。 环境:MSSQL SERV...
阅读全文
浙公网安备 33010602011771号