Introduction:
In this article I will explain how to find or get last modified date and created date of stored procedure or table in SQL server.
In this article I will explain how to find or get last modified date and created date of stored procedure or table in SQL server.
Description:
In
previous articles I explained difference between function and stored procedures, joins in SQL Server, substring function in SQL server
and many articles relating to SQL
server. Now I will explain how to get last modified date or created date of
stored procedure or table in SQL
server.
To
get created date or last modified date
of stored procedure we need to write the query like this
SELECT name,type,type_desc,create_date,modify_date FROM sys.objects
WHERE type = 'P' AND name = 'YourProcedureName'
|
Here
if you observe above query I mentioned type = 'P' this mean to identify stored procedure or table or function
etc based on 'P','U','FN',etc…
Here type = 'P' (Procedure)
type = 'U' (User Table)
type = 'S' (System
Table)
type = 'PK' (Primary Key)
type = 'FN' (Scalar Function)
Suppose
if we want to get modified or created
date of table we need to mention type = 'U' and the query will be like this
SELECT name,type,type_desc,create_date,modify_date FROM sys.objects
WHERE type = 'U' AND name = 'YourTableName'
|
Example:
SELECT name,[type],type_desc,create_date,modify_date FROM sys.objects
WHERE [type] = 'P' AND name = 'GetUserDetails'
|
Output:
|
If you enjoyed this post, please support the blog below. It's FREE! Get the latest Asp.net, C#.net, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email. |
|||
|
|||
5 comments :
Really nice but i have a dought
i create one stored procedure
i altered that stored procedure
now i want to stored procedure before altered
how can i get that stored procedure
Please Provide a Solution Please.....
Thanks & Regards
Vinay Kumar
@vinay...
If you are maintain the backup for your database then only u have chance to get old procedure otherwise it's not possible.
how can i get values into dropdownlist from sql using stored procedure
alya chacka
atlu pan nahi avdtu !!
to su karva avta hasho ????
aena karta chod do . bka chaka!!!!
For special Ajesh Chacko Chacko.....
Hi Suresh,
Very nice blog i got my answer of my problem from ur blog. Thanks!!
Note: Only a member of this blog may post a comment.