Home All Groups Group Topic Archive Search About

Stored procedures change date

Author
20 Oct 2006 12:50 PM
Jonas
Hi, where can I find last change date for a stored procedure, in management
studio it shows create-date but not when it last changed.
Good to have when there are lots of developers on a test server...

Thanx

Jonas

Author
20 Oct 2006 1:09 PM
Keith Kratochvil
Check the information_schema.routines view

SELECT SPECIFIC_NAME, CREATED, LAST_ALTERED
FROM information_schema.routines

Do you store scripts for your objects in a source code repository (such as
VSS)?  It is a good idea because it allows you to see what changed, when it
changed, who changed it, and what the previous version(s) looked like.  If
you aren't creating your objects from scripts and storing those scripts
within a source code repository, I encourage you to think about that option.

--
Keith Kratochvil


Show quote
"Jonas" <Jo***@discussions.microsoft.com> wrote in message
news:8B32D938-6ED6-4208-9CB5-01F77B240A1E@microsoft.com...
> Hi, where can I find last change date for a stored procedure, in
> management
> studio it shows create-date but not when it last changed.
> Good to have when there are lots of developers on a test server...
>
> Thanx
>
> Jonas
Author
23 Oct 2006 8:42 AM
Jonas
Show quote
"Keith Kratochvil" wrote:

> Check the information_schema.routines view
>
> SELECT SPECIFIC_NAME, CREATED, LAST_ALTERED
> FROM information_schema.routines
>
> Do you store scripts for your objects in a source code repository (such as
> VSS)?  It is a good idea because it allows you to see what changed, when it
> changed, who changed it, and what the previous version(s) looked like.  If
> you aren't creating your objects from scripts and storing those scripts
> within a source code repository, I encourage you to think about that option.
>
> --
> Keith Kratochvil
>
>
> "Jonas" <Jo***@discussions.microsoft.com> wrote in message
> news:8B32D938-6ED6-4208-9CB5-01F77B240A1E@microsoft.com...
> > Hi, where can I find last change date for a stored procedure, in
> > management
> > studio it shows create-date but not when it last changed.
> > Good to have when there are lots of developers on a test server...
> >
> > Thanx
> >
> > Jonas
>
>
>

Thank you Keith (and Andrew too).

We will consider using source safe or other source code repository, what
alternatives is there to VSS?

Regards Jonas
Author
20 Oct 2006 8:08 PM
Andrew J. Kelly
There is not a way to see the last changed date unless you use a source
control tool as mentioned or you always drop and recreate. An ALTER will not
change any dates.

--
Andrew J. Kelly SQL MVP

Show quote
"Jonas" <Jo***@discussions.microsoft.com> wrote in message
news:8B32D938-6ED6-4208-9CB5-01F77B240A1E@microsoft.com...
> Hi, where can I find last change date for a stored procedure, in
> management
> studio it shows create-date but not when it last changed.
> Good to have when there are lots of developers on a test server...
>
> Thanx
>
> Jonas
Author
23 Oct 2006 9:09 AM
Tibor Karaszi
In SQL Server 2005, meta-data is kept for modifications. For procedures, this is visible through
sys.procedures and INFORMATION_SCHEMA.MODULES.

I fully agree about using source control, I should add...

USE tempdb
GO
CREATE PROC p AS SELECT 1
GO
SELECT name, create_date, modify_date FROM sys.procedures
GO
ALTER PROC p AS SELECT 2
GO
SELECT name, create_date, modify_date FROM sys.procedures
GO
SELECT SPECIFIC_NAME, CREATED, LAST_ALTERED
FROM information_schema.routines


Show quote
"Andrew J. Kelly" <sqlmvpnooospam@shadhawk.com> wrote in message
news:eJs%23EOI9GHA.3280@TK2MSFTNGP02.phx.gbl...
> There is not a way to see the last changed date unless you use a source control tool as mentioned
> or you always drop and recreate. An ALTER will not change any dates.
>
> --
> Andrew J. Kelly SQL MVP
>
> "Jonas" <Jo***@discussions.microsoft.com> wrote in message
> news:8B32D938-6ED6-4208-9CB5-01F77B240A1E@microsoft.com...
>> Hi, where can I find last change date for a stored procedure, in management
>> studio it shows create-date but not when it last changed.
>> Good to have when there are lots of developers on a test server...
>>
>> Thanx
>>
>> Jonas
>
>

AddThis Social Bookmark Button