Monday, August 10, 2015

SQL Server development provision



SQL Server development provision 

Provision 1:- 

How to find the procedure in the data base

SELECT * FROM sys.procedures p WHERE p.name LIKE '%%'
SELECT * FROM INFORMATION_SCHEMA.ROUTINES r WHERE r.ROUTINE_NAME LIKE '%%'

Provision 2:- 

How to get the procedure definition of the procedure 

SELECT OBJECT_DEFINITION(OBJECT_ID(p.name)),* FROM sys.procedures p
WHERE OBJECT_DEFINITION(OBJECT_ID(p.name)) LIKE '%%'

Provision 3:- 

How to get the tables in the data base 

SELECT * FROM sys.tables t WHERE t.name LIKE '%%'
SELECT * FROM INFORMATION_SCHEMA.TABLES t WHERE t.TABLE_NAME LIKE '%%'

Provision 4:-

How to get the column names from the data base 

SELECT * FROM sys.columns c WHERE c.name LIKE '%%'
SELECT * FROM INFORMATION_SCHEMA.COLUMNS c WHERE c.COLUMN_NAME LIKE '%%'


No comments:

Post a Comment