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

SQL SERVER ´æ´¢¹ý³Ì¼ÓÃܺͽâÃÜ

create PROCEDURE sp_decrypt(@objectname varchar(50))
AS
begin
set nocount on
--CSDN£ºj9988 copyright:2004.07.15
--V3.2
--ÆÆ½â×Ö½Ú²»ÊÜÏÞÖÆ£¬ÊÊÓÃÓÚSQLSERVER2000´æ´¢¹ý³Ì£¬º¯Êý£¬ÊÓͼ£¬´¥·¢Æ÷
--ÐÞÕýÉÏÒ»°æ"ÊÓͼ´¥·¢Æ÷"²»ÄÜÕýÈ·½âÃÜ´íÎó
--·¢ÏÖÓÐ´í£¬ÇëE_MAIL£ºCSDNj9988@tom.com
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 '
else 'Alter PROCEDURE '+ @objectname+' WITH ENCRYPTION AS '
end)
if @type='TR'
begin
declare @parent_obj varchar(255),@tr_parent_xtype varchar(10)
select @parent_obj=parent_obj from sysobjects where id=object_id(@objectname)
select @tr_parent_xtype=xtype from sysobjects where id=@parent_obj
if @tr_parent_xtype='V'
begin
set @sql1='Alter TRIGGER '+@objectname+'
ON '+OBJECT_NAME(@parentid)+' WITH ENCRYPTION INSTERD OF Insert AS PRINT 1 '
end
else
begin
set @sql1='Alter TRIGGER '+@objectname+'
ON '+OBJECT_NAME(@parentid)+' WITH ENCRYPTION FOR Insert AS PRINT 1 '
end
end
if @type='FN' or @type='TF' or @type='IF'
set @sql1=(case @type when 'TF' then
'Alter
FUNCTION '+ @objectn


Ïà¹ØÎĵµ£º

È¡mysql±íºÍ×Ö¶Î×¢Ê͵ÄsqlÓï¾ä

½ñÌìÕÒµ½ÁËÈ¡mysql±íºÍ×Ö¶Î×¢Ê͵ÄÓï¾ä
È¡×Ö¶Î×¢ÊÍ
SELECT COLUMN_NAME ÁÐÃû, DATA_TYPE ×Ö¶ÎÀàÐÍ, COLUMN_COMMENT ×Ö¶Î×¢ÊÍ
from INFORMATION_SCHEMA.COLUMNS
WHERE table_name = 'companies'##±íÃû
AND table_schema = 'testhuicard'##Êý¾Ý¿âÃû
AND column_name LIKE 'c_name'##×Ö¶ÎÃû
--------------------------- ......

±í½á¹¹ÐÅÏ¢²éѯ sql server 2005


--sql server 2005
-- 1. ±í½á¹¹ÐÅÏ¢²éѯ
-- ========================================================================
-- ±í½á¹¹ÐÅÏ¢²éѯ
-- ×Þ½¨ 2005.08(ÒýÓÃÇë±£Áô´ËÐÅÏ¢)
-- ========================================================================
SELECT
    TableName=CASE WHEN ......

SQL SERVER 2005 ¼ò½é


      SQL SERVER 2005 ¼ò½é
    Ò»Ö±ÒÔÀ´£¬T-SQL¶¼ÊÇÈÝÒ×ÉÏÊֵĽṹ»¯²éѯÓïÑÔ£¬Ëæ×ÅSQL ServerµÄ°æ±¾Ñݽø£¬³ýÁËÄÚ²¿¹¦ÄÜÔö¼Ó£¬
T-SQLÒ²´ó·ùÀ©ÔöÁËеIJéѯָÁî¡£ÀýÈ磺XQuery¡¢È¡µÃÅÅÃû˳ÐòµÄº¯Êý¡¢¼¯ºÏÔËËã´îÅäOVERÔËËã·û¡¢TOPÔËËã·û¿ÉÒÔ´îÅä±äÁ¿»ò×Ó²éѯ£¬ÒÔ¼°Í ......

¹ØÓÚSQL SERVER Êý¾Ý²ð·Ö

if object_id('tb') is not null drop table tb
go
create table tb([A] varchar(10),[B] int)
insert tb
select 'bcd',1 union all
select 'bcde',2 union all
select 'cd',3
go
¸öÈË·ÖÎöÕâµÀÌâµÄ˼·ÊÇ£º
ͨ¹ýSubstring() À´Ñ­»··Ö¸î B ÁÐϵÄ×Ö·û´®¡£¡£
--ÏëµÃµ½µÄ½á¹û£º
/**
a    b& ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ