Friday, March 23, 2012

LAST_ALTERED Stored Procedure

Hi,
Is there anyway to find out the last altered date of a specific stored
procedure.
I tried Information_Schema.Routines but the value in that column doesn't
change after I modify the stored procedure.
When I look at BOL, it said "The last time the function was modified"
How to find out the date of all last_altered sp then'
Thanks
EdmundYou can't. SQL doesn't store this information.
Drop and recreate the procedure.
"Ed" <Ed@.discussions.microsoft.com> wrote in message
news:F9223ED0-2791-4CCC-9A6D-6A3BAC640D10@.microsoft.com...
> Hi,
> Is there anyway to find out the last altered date of a specific stored
> procedure.
> I tried Information_Schema.Routines but the value in that column doesn't
> change after I modify the stored procedure.
> When I look at BOL, it said "The last time the function was modified"
> How to find out the date of all last_altered sp then'
> Thanks
> Edmund
>|||what is the LAST_ALTERED column for under Information_Schema.Routines since
I
don't see the value of this column can be changed!!!!
Ed
"Raymond D'Anjou" wrote:

> You can't. SQL doesn't store this information.
> Drop and recreate the procedure.
> "Ed" <Ed@.discussions.microsoft.com> wrote in message
> news:F9223ED0-2791-4CCC-9A6D-6A3BAC640D10@.microsoft.com...
>
>|||These views are defined by ANSI SQL, to they "have to" be present in SQL Ser
ver whether the
information is actually available or not. Read the source for the view and y
ou see that it actually
displays creation date. Books Online is not correct, though, as it states it
is last time altered...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Ed" <Ed@.discussions.microsoft.com> wrote in message
news:28240995-CC07-4103-A1F7-6992939B7035@.microsoft.com...
> what is the LAST_ALTERED column for under Information_Schema.Routines sinc
e I
> don't see the value of this column can be changed!!!!
> Ed
> "Raymond D'Anjou" wrote:
>|||"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:%23kFf4e%23WFHA.2124@.TK2MSFTNGP14.phx.gbl...
> These views are defined by ANSI SQL, to they "have to" be present in SQL
> Server whether the information is actually available or not. Read the
> source for the view and you see that it actually displays creation date.
> Books Online is not correct, though, as it states it is last time
> altered...
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
Funny.
It's as if I told my client:
I'm obligated to give you a report of your accounts receivables
The amounts are wrong, but you have your report.|||It is probably just a TBD that just fell through the cracks. I once tried to
add a trigger to the sysobjects table that would update the column with
getdate() when a record where xtype='P' is inserted or updated, but this is
not allowed.
"Raymond D'Anjou" <rdanjou@.savantsoftNOSPAM.net> wrote in message
news:uAQmiv%23WFHA.2692@.TK2MSFTNGP15.phx.gbl...
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote
in
> message news:%23kFf4e%23WFHA.2124@.TK2MSFTNGP14.phx.gbl...
> Funny.
> It's as if I told my client:
> I'm obligated to give you a report of your accounts receivables
> The amounts are wrong, but you have your report.
>|||LOL... I agree. It would be better to display NULL and document it properly.
.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Raymond D'Anjou" <rdanjou@.savantsoftNOSPAM.net> wrote in message
news:uAQmiv%23WFHA.2692@.TK2MSFTNGP15.phx.gbl...
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote i
n message
> news:%23kFf4e%23WFHA.2124@.TK2MSFTNGP14.phx.gbl...
> Funny.
> It's as if I told my client:
> I'm obligated to give you a report of your accounts receivables
> The amounts are wrong, but you have your report.
>|||You DO know that anything, including SELECTs, on System tables are
unsupported.
That's because these tables could change in any upgrade or service pack.
"JT" <someone@.microsoft.com> wrote in message
news:%23jNUtK$WFHA.3140@.TK2MSFTNGP14.phx.gbl...
> It is probably just a TBD that just fell through the cracks. I once tried
> to
> add a trigger to the sysobjects table that would update the column with
> getdate() when a record where xtype='P' is inserted or updated, but this
> is
> not allowed.
> "Raymond D'Anjou" <rdanjou@.savantsoftNOSPAM.net> wrote in message
> news:uAQmiv%23WFHA.2692@.TK2MSFTNGP15.phx.gbl...
> in
>|||Technically, the SELECT against the system tables is supported, as long as y
ou don't derive
information from columns that aren't documented. But the intent if correct,
the structure of the
system tables will change in next version. The will be "replaced" by catalog
views, but still exist
for backwards compatibility and most code will run without changes (assuming
reserved and
non-documented columns has been used).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Raymond D'Anjou" <rdanjou@.savantsoftNOSPAM.net> wrote in message
news:uXlGE8GXFHA.3584@.TK2MSFTNGP14.phx.gbl...
> You DO know that anything, including SELECTs, on System tables are unsuppo
rted.
> That's because these tables could change in any upgrade or service pack.
> "JT" <someone@.microsoft.com> wrote in message news:%23jNUtK$WFHA.3140@.TK2M
SFTNGP14.phx.gbl...
>|||Thanks Tibor.
I've gone over to the dark side a few times and directly queried system
tables but I've never included these in production code.
Off the top of your head, do you know of any system table information that
cannot be obtained by using "Information schema views" or "System stored
procedures".
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:uGWA6rHXFHA.2540@.tk2msftngp13.phx.gbl...
> Technically, the SELECT against the system tables is supported, as long as
> you don't derive information from columns that aren't documented. But the
> intent if correct, the structure of the system tables will change in next
> version. The will be "replaced" by catalog views, but still exist for
> backwards compatibility and most code will run without changes (assuming
> reserved and non-documented columns has been used).
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Raymond D'Anjou" <rdanjou@.savantsoftNOSPAM.net> wrote in message
> news:uXlGE8GXFHA.3584@.TK2MSFTNGP14.phx.gbl...
>

No comments:

Post a Comment