Wednesday, 12 October 2011

Sql important querys to search records

+++++++++++++Display SP list according modified date descending++++++++++++++++
SELECT name, create_date, modify_date
FROM sys.objects
WHERE type = 'P'
order by modify_date desc
+++++++++ Display Table list according modified date ++++++++++++++++++++
SELECT name, modify_date
FROM sys.objects
WHERE type = 'U'
order by modify_date desc
-----------------------------------
select obj.Name, * from syscomments  cm
Left outer join  sys.objects  obj on cm.id=obj.object_id
where cm.text like '%netra%'
-------------------search column names------------
select table_name from information_schema.columns where column_name='State_Id'

No comments:

Post a Comment