Friday, March 23, 2012

last updated date on stored procs

Hi
I've change quite a few stored procs and wondered if there's any way of
getting a last updated date. I only want to upload the changed procs to the
live server and don't want to transfer all of them.
Cheers
JamesThere is no easy way to do this because there no 'last changed date' stored
with the sp... There is a schema_ver field which changes when the sp is
altered... You would have to keep a copy yourself in a table and compare it
to the field in sysobjects...You could also add local variables to each SP
with a last changed date that must be incremented by the changer...but that
is all a pain in the butt... There are programs like(Red Gate ) which can
compare differences and let you know... But the bottom line is that you get
no help from SQL...
"James Brett" <james.brett@.unified.co.uk> wrote in message
news:%233A4OlYiDHA.2748@.TK2MSFTNGP11.phx.gbl...
> Hi
> I've change quite a few stored procs and wondered if there's any way of
> getting a last updated date. I only want to upload the changed procs to
the
> live server and don't want to transfer all of them.
> Cheers
> James
>|||Not if you are altering procedures. Only the creation date
is available. SQL Server doesn't track the modification
dates. You could do something like use a third party tool to
compare the differences between development and production
to find the stored procedures that are different between the
two environments. But you can easily have modified objects
in dev that really aren't intended to be moved to the live
server so you have to be careful using this approach.
Red Gate has tools to compare databases:
http://www.red-gate.com/
-Sue
On Fri, 3 Oct 2003 09:41:20 +0100, "James Brett"
<james.brett@.unified.co.uk> wrote:
>Hi
>I've change quite a few stored procs and wondered if there's any way of
>getting a last updated date. I only want to upload the changed procs to the
>live server and don't want to transfer all of them.
>Cheers
>James
>|||Hey Wayne,
FYI...Didn't mean to step on your response or anything. It
will be nice when the servers are back in shape and we can
see other replies posted with less latency before posting
our own.
The joys of Swen...
-Sue
On Fri, 3 Oct 2003 08:18:21 -0400, "Wayne Snyder"
<wsnyder@.computeredservices.com> wrote:
>There is no easy way to do this because there no 'last changed date' stored
>with the sp... There is a schema_ver field which changes when the sp is
>altered... You would have to keep a copy yourself in a table and compare it
>to the field in sysobjects...You could also add local variables to each SP
>with a last changed date that must be incremented by the changer...but that
>is all a pain in the butt... There are programs like(Red Gate ) which can
>compare differences and let you know... But the bottom line is that you get
>no help from SQL...
>"James Brett" <james.brett@.unified.co.uk> wrote in message
>news:%233A4OlYiDHA.2748@.TK2MSFTNGP11.phx.gbl...
>> Hi
>> I've change quite a few stored procs and wondered if there's any way of
>> getting a last updated date. I only want to upload the changed procs to
>the
>> live server and don't want to transfer all of them.
>> Cheers
>> James
>>
>

No comments:

Post a Comment