ASP.NET (35) SQL (25) JAVASCRIPT (24) HTML (14) STYLE SHEET (6) ASP (4) SCRIPT (1)

Search me out HERE!!

List out last modified procedures and functions in SQL

Use below query to find out last modified stored procedures, functions, views and tables from Sql Server.

SELECT name, create_date, modify_date,type
FROM sys.objects
WHERE type IN ('FN','V','P','U','TF')
AND DATEDIFF(D,modify_date, GETDATE()) < 6
ORDER BY modify_date


Here are different types used in IN clause in WHERE condition:

  • FN – Scalar valued function
  • V – View
  • P – Stored Procedure
  • U – Table
  • TF – Table valued function
DATEDIFF(D,modify_date, GETDATE()) < 6 – It will show the objects modified in last 6 days

No comments:

Post a Comment