Find Created Date and Modified Date – SQL Server

Just a day ago I was working with database. I wanted to know the recently modified date of Store procedure and table. After searching on net I come up with solution. I found simple script to get list of store procedure modified in last 3 days.

Using this script you can retrieve created date and modified date.

SELECT name, modify_date, create_date,

FROM sys.objects

WHERE type = ‘P’

AND DATEDIFF(D,modify_date, GETDATE()) < 3

ORDER BY modify_date DESC

Type: whether it is table, store procedure, etc.

  • S = System Table
  • PK = Primary Key
  • U = User Table
  • P = Stored Procedure
  • TF = Table Value Function
  • FN = Scalar Function
  • D = Default Constraint
  • create_date = Date when it is created
  • modify_date = Last modified date time of table, store procedure, etc.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s