This article is half-done without your Comment! *** Please share your thoughts via Comment ***
In this post, I am sharing a script to find any text, column name, comment and object name from the SQL Server.
Below are the different scripts:
1 2 3 |
/*Find any text or object in SQL Server Objects*/ SELECT *FROM sys.objects WHERE OBJECT_DEFINITION (OBJECT_ID) LIKE '%tbl_Employee%' |
1 2 3 4 5 |
/*Find any text or object in SQL Server Comments*/ SELECT DISTINCT sysob.name FROM syscomments AS sysco INNER JOIN sysobjects AS sysob ON sysco.id=sysob.id WHERE sysco.TEXT LIKE '%Order%' |
1 2 3 4 5 6 7 8 9 |
/*Find any column in database*/ SELECT TABLE_SCHEMA ,TABLE_NAME ,COLUMN_NAME ,DATA_TYPE ,COLUMN_DEFAULT FROM INFORMATION_SCHEMA.columns WHERE COLUMN_NAME LIKE '% |