>  기사  >  데이터 베이스  >  查询需要的字符串所在的存储过程及函数

查询需要的字符串所在的存储过程及函数

WBOY
WBOY원래의
2016-06-07 14:56:371390검색

查询需要的字符串所在的存储过程及函数 无 CREATE PROCEDURE[dbo].[StringSearchInSQLObject] @TextToSearchVARCHAR(2000)ASSELECT DISTINCTOBJECT_NAME(sc.id)AS'OBJECT NAME',USER_NAME(so.uid)AS'OBJECT OWNER',CASEWHEN so.xtype='C'THEN'CHECK constrai

查询需要的字符串所在的存储过程及函数

CREATE PROCEDURE[dbo].[StringSearchInSQLObject] 
@TextToSearchVARCHAR(2000)
AS
SELECT DISTINCT
OBJECT_NAME(sc.id)AS'OBJECT NAME',
USER_NAME(so.uid)AS'OBJECT OWNER',
CASE
WHEN so.xtype='C'THEN'CHECK constraint'
WHEN so.xtype='D'THEN'DEFAULT or DEFAULT constraint'
WHEN so.xtype='F'THEN'FOREIGN KEY constraint'
WHEN so.xtype='L'THEN'Log'
WHEN so.xtype='FN'THEN'Scalar function'
WHEN so.xtype='IF'THEN'Inlined table-function'
WHEN so.xtype='P'THEN'Stored procedure'
WHEN so.xtype='PK'THEN'PRIMARY KEY constraint (type is K)'
WHEN so.xtype='RF'THEN'Replication filter stored procedure'
WHEN so.xtype='S'THEN'System table'
WHEN so.xtype='TF'THEN'Table function'
WHEN so.xtype='TR'THEN'Trigger'
WHEN so.xtype='U'THEN'User table'
WHEN so.xtype='UQ'THEN'UNIQUE constraint (type is K)'
WHEN so.xtype='V'THEN'View'
WHEN so.xtype='X'THEN'Extended stored procedure'
END AS'OBJECT TYPE',
CASE
WHEN sc.encrypted=0THEN'Not encrypted'
WHEN sc.encrypted=1THEN'Encrypted'
END AS'ENCRYPTED',
CASE
WHEN sc.compressed=0THEN'Not compressed'
WHEN sc.compressed=1THEN'Compressed'
END AS'COMPRESSED',
so.crdate AS'CREATE DATE',
sc.id AS'OBJECT ID'
FROM syscomments sc INNER JOIN sysobjects soONsc.id=so.id
WHERE sc.textLIKE@TextToSearch
ORDER BY'OBJECT TYPE','OBJECT NAME'
성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.