July 10, 2012 at 2:52 am
i have a Stored Procedure (SP1) which calls multiple other Stored Procedures.
I've noticed that a call to one Stored Procedure is not being made from SP1.
I'm wondering whether it was ever there, so... is it possible to find if it was, who may have removed it and at what date/time?
I have a piece of code, as below, that tells me when an object has been created and modified, but not what that modification was.
SELECT name, type_desc,create_date,modify_date, [type]
FROM sys.objects
--WHERE type = 'P'
WHERE --DATEDIFF(D,modify_date, GETDATE()) < 10
--and
name = 'my_SP'
order by modify_date
July 10, 2012 at 3:28 am
Nope. SQL Server doesn't store versioned information about the objects inside of it. There's no way to get that directly. My recommendation, put all your database T-SQL code into source control. That way you have a managed, versioned view of the objects. If you always deploy changes from source control, then you can also know who made changes as well as understanding when they occurred.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
July 10, 2012 at 3:55 am
aah well, never mind. thanks anyway 🙂
I shall have a look at Source Control products out there and what they do.
cheers
July 10, 2012 at 4:05 am
i have a Stored Procedure (SP1) which calls multiple other Stored Procedures.
I've noticed that a call to one Stored Procedure is not being made from SP1.
I'm wondering whether it was ever there, so... is it possible to find if it was, who may have removed it and at what date/time?
you can try to search the old backup and restore with some other name. If SP is there then you will be able to see the difference(if the restore is old enough to verify)
----------
Ashish
July 10, 2012 at 4:14 am
there is a report that you can run that till tell you who last changed the stored procedure and when. from ssms navigate to your database, right mouse click on the database, select reports, standard reports, schema changes.
Also look at DDL triggers, i use a DDL triger to audit all stored procedure changes
***The first step is always the hardest *******
July 10, 2012 at 4:18 am
there is a report that you can run that till tell you who last changed the stored procedure and when. from ssms navigate to your database, right mouse click on the database, select reports, standard reports, schema changes.
only if the audit is enabled at instance level and sql services not restarted.
----------
Ashish
July 10, 2012 at 5:44 am
SGT_squeequal (7/10/2012)
there is a report that you can run that till tell you who last changed the stored procedure and when. from ssms navigate to your database, right mouse click on the database, select reports, standard reports, schema changes.Also look at DDL triggers, i use a DDL triger to audit all stored procedure changes
thanks. unfortunately, i am now the last person to change the stored procedure as i added the stored procedure call back in 😀
i'll remember this for next time though 😎
July 10, 2012 at 5:50 am
crazy4sql (7/10/2012)
there is a report that you can run that till tell you who last changed the stored procedure and when. from ssms navigate to your database, right mouse click on the database, select reports, standard reports, schema changes.
only if the audit is enabled at instance level and sql services not restarted.
no, i think that's just a standard report that hits the default trace, which is enabled by default.
the default trace is limited to the last 100 meg of DDL changes ont eh whole server, so one developer database that gets lots of changes can push other changes out of the log as it gets reused, so time is important when you grab this report.
so that will give you a list of who changed it , if it hasn'be been aged out of the default trace.
Lowell
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply