Query the stored procedure and function of the required string

Source: Internet
Author: User
No CREATEPROCEDURE [dbo] is available for the stored procedure and function where the required string is located. [StringSearchInSQLObject] @ TextToSearchVARCHAR (2000) ASSELECTDISTINCTOBJECT_NAME (SC. id) ASOBJECTNAME, USER_NAME (so. uid) ASOBJECTOWNER, casewhint32. xtypeCTHENCHECKconstrai

No create procedure [dbo] is available for the stored PROCEDURE and function where the required string is located. [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

Query the stored procedure and function of the required string <无>
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 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',CASEWHEN sc.encrypted=0THEN'Not encrypted'WHEN sc.encrypted=1THEN'Encrypted'END AS'ENCRYPTED',CASEWHEN 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.idWHERE sc.textLIKE@TextToSearchORDER BY'OBJECT TYPE','OBJECT NAME'

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.