Some Useful SQL Scripts Which I Came Across
-
List Of all Tables and their columns along with datatypes
SELECT o.Name as TableName,c.Name as ColumnName,t.name as DataType,t.length as [DataLength] FROM sysobjects o JOIN syscolumns c ON o.id = c.id JOIN systypes t ON c.xtype = t.xtype WHERE o.xtype = 'u' ORDER By o.name
- Search for a string accross all procedures
SELECT name
FROM sys.procedures
WHERE Object_definition(object_id) LIKE '%EmployeeBenefits%'
Thanks,
Pavan Kumar Aryasomayajulu