Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 procedure last changed date

Author  Topic 

ingineu
Yak Posting Veteran

89 Posts

Posted - 2005-10-15 : 12:54:26
I am trying to find the last changed date for a procedure. I have located the date created in the sysobjects table (crdate). Is this available?

robvolk
Most Valuable Yak

15732 Posts

Posted - 2005-10-15 : 13:14:42
crdate only shows creation date. If the sproc was dropped and re-created, then that date is correct. If the proc was altered it will not update the crdate value.

The best way to properly track stored procedure changes is through source control.
Go to Top of Page

ingineu
Yak Posting Veteran

89 Posts

Posted - 2005-10-15 : 14:10:42
I assume you are referring to a separate package I would need to purchase. Maybe the best route for me would be to add a line to the SPROC as a comment identifying the last date changed. I could most likely pickup that date in my Access Report that displays a list of procedures.
Go to Top of Page

sachinsamuel
Constraint Violating Yak Guru

383 Posts

Posted - 2005-10-15 : 14:22:20
There are many Source control tools available. I will recomend to use Microsoft VSS. Its very easy and powerfull. It is shiped with Visual studio.

If you enter comment manualy, then chances are there that you make mistakes. Or else make a practice to drop and create procedure while making changes to them as already suggested by Robvolk.

Regards
Sachin
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2005-10-15 : 15:39:32
You can also use CVS or Subversion for your source control needs, both are free:

http://www.march-hare.com/cvspro/
http://subversion.tigris.org/
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2005-10-16 : 01:41:30
"Maybe the best route for me would be to add a line to the SPROC as a comment identifying the last date changed"

We have a stored procedure call at the top of each of our Create Sproc source files, which has a version number. That inserts a row into a log table whenever the file is run - so we get the date, and version number, when it was run - and we can compare the values between Development, QA and Production databases.

Kristen
Go to Top of Page

blindman
Master Smack Fu Yak Hacker

2365 Posts

Posted - 2005-10-16 : 02:11:07
Cool idea.
Go to Top of Page

ingineu
Yak Posting Veteran

89 Posts

Posted - 2005-10-16 : 14:56:53
Thanks for all your responses. I'll have to think on this one.
Go to Top of Page

ingineu
Yak Posting Veteran

89 Posts

Posted - 2005-10-16 : 15:48:57
I decided to fire off a message to Microsoft, asking them to add the Date Last Changed. Most likely it will be shelved, but at least it's a try.
Go to Top of Page
   

- Advertisement -