Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

SQL½âÃÜctext×Ö¶ÎÄÚÈݺ¯Êý

--SQL½âÃÜctext×Ö¶ÎÄÚÈݺ¯Êý
--exec sp_decrypt 'Ô¼ÊøÃû³Æ'
--exec sp_decrypt 'DF_InsuranceRecord_PeriodUnit'
--exec sp_decrypt '´æ´¢¹ý³ÌÃû³Æ'
--exec sp_decrypt 'sp_SearchPrinting_InsuranceRecord'
--Ö÷ÒªÓÃ;:¶ÁÈ¡systemcommentsÖеÄ×Ö¶ÎÄÚÈÝ¡£°üÀ¨Ô¼Êø,´æ´¢¹ý³ÌµÈµÈ¡£
--Ô­ÎÄÓ¦¸ÃÀ´×Ôhttp://blog.csdn.net/j9988/archive/2004/04/16/16747.aspx,×÷Õß·¢²¼ÎÄÕÂÖ»ÓÐ3ƪ,¿ÉÄÜתÁËÒÆBLOG.²»¹ýȷʵÊǸßÊÖ¡£Ê¡È´ÁËÎҺܶàµÄʱ¼ä¡£±¾À´´òËãÏÈÕÒOX×Ö·û´«¸ñʽµÄÆƽ⺯Êý,»òÕßÔÚC#ÖнâÃܵÄviabanry(8000)×Ö¶ÎÄÚÈÝ¡£
--´æÔÚ´æ´¢ ¹ý³Ì³¬¹ý4000ʱºò»á»»ÐеÄһЩÆÀÂÛÖз´Ó³µÄÎÊÌâ¡£³öÏÖ´íÎóÎһἰʱÐÞÕý¡£
CREATE  PROCEDURE sp_decrypt(@objectName varchar(50)) 
AS 
begin 
set nocount on 
begin tran 
declare @objectname1 varchar(100),@orgvarbin varbinary(8000) 
declare @sql1 nvarchar(4000),@sql2 varchar(8000),@sql3 nvarchar(4000),@sql4 nvarchar(4000) 
DECLARE  @OrigSpText1 nvarchar(4000),  @OrigSpText2 nvarchar(4000) , @OrigSpText3 nvarchar(4000), @resultsp nvarchar(4000) 
declare  @i int,@status int,@type varchar(10),@parentid int 
declare @colid int,@n int,@q int,@j int,@k int,@encrypted int,@number int 
select @type=xtype,@parentid=parent_obj from sysobjects where id=object_id(@ObjectName) 
 
create table  #temp(number int,colid int,ctext varbinary(8000),encrypted int,status int) 
insert #temp SELECT number,colid,ctext,encrypted,status from syscomments  WHERE id = object_id(@objectName) 
select @number=max(number) from #temp 
set @k=0 
 
while @k<=@number  
begin 
if exists(select 1 from syscomments where id=object_id(@objectname) and number=@k) 
begin 
if @type='P' 
set @sql1=(case when @number>1 then 'ALTER PROCEDURE '+ @objectName +';'+rtrim(@k)+' WITH ENCRYPTION AS ' 
                        


Ïà¹ØÎĵµ£º

¼¸¸öSQL ServerÓï¾äºÍ´æ´¢¹ý³Ì

-- ======================================================
--ÁгöSQL SERVER ËùÓÐ±í£¬×Ö¶ÎÃû£¬Ö÷¼ü£¬ÀàÐÍ£¬³¤¶È£¬Ð¡ÊýλÊýµÈÐÅÏ¢
--ÔÚ²éѯ·ÖÎöÆ÷ÀïÔËÐм´¿É,¿ÉÒÔÉú³ÉÒ»¸ö±í£¬µ¼³öµ½EXCELÖÐ
-- ======================================================
SELECT
       (case when a. ......

SQL 2005 ÖÐÊý¾Ýµ¼ÈëºÍµ¼³ö²Ù×÷²½Öè


ÒÔÇ°ÔÚ2000Àï¿ÉÒÔÊý¾Ýµ¼Èëµ¼³ö£¬µ±È»ÔÚ2005ÀïÒ²²»ÀýÍ⣬ͬÑùÓÐÕâÑùµÄ²Ù×÷£¬Ö»ÊÇÔÚ²Ù×÷ÉϺÍ2000ÓеãÇø±ð£¬ÏÂÃæͨ¹ýͼÎĵķ½·¨½ÌÄãÔõÑùµ¼Èëµ¼³öÊý¾Ý¡£
²Ù×÷²½Ö裺
1¡¢Èçͼ£¬ÔÚ“¶ÔÏó×ÊÁϹÜÀíÆ÷”ÀÓÒ»÷ÄãÒªµ¼Èëµ¼³öÊý¾ÝµÄÊý¾Ý¿â£¬Ñ¡Ôñ“ÈÎÎñ”ÀïµÄµ¼ÈëÊý¾Ý»òµ¼³öÊý¾Ý£¬ÎÒÕâÀïÒÔµ¼ÈëÊý¾ÝΪÀý£¬µ¼³öÊ ......

sql server ´´½¨±íʱΪÁÐÌí¼Ó˵Ã÷


IF NOT EXISTS (SELECT * from ::fn_listextendedproperty
(N'MS_Description' , N'SCHEMA',N'dbo',
N'TABLE',N'±íÃû', N'COLUMN',N'ÁÐÃû'))
EXEC sys.sp_addextendedproperty @name=N'MS_Description',
@value=N'˵Ã÷ÄÚÈÝ' , @level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'±íà ......

SQL Server 2008 ¶¨Ê±×÷ÒµµÄÖƶ¨(SQL2005²Î¿¼´Ë·½·¨)

--------------------------------------------------------------------------
--  Author : htl258(Tony)
--  Date   : 2010-04-29 19:07:45
--  Version:Microsoft SQL Server 2008 (RTM) - 10.0.1600.22 (Intel X86)
--          Jul  ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ