Monday, July 16, 2012

SQL Query list where SP,Function and Table Created and Modified

-- To get the SP list
--USE DBName;
--GO
SELECT name, create_date, modify_date
FROM sys.objects
WHERE type = 'P' order by modify_date Desc
--AND name = 'uspUpdateEmployeeHireInfo'
--GO

-- To get the User Defined function list
--USE AdventureWorks;
--GO
SELECT name, create_date, modify_date
FROM sys.objects
WHERE type = 'FN' order by modify_date Desc
--AND name = 'uspUpdateEmployeeHireInfo'
--GO

-- To get the Table list
SELECT name,Create_date,Modify_date
FROM sys.Tables
order by modify_date Desc