user1186256
user1186256

Reputation: 197

Find out who modified a stored procedure

Is there a way using tsql to tell who was the last person to modify a stored procedure?

I am trying to find my changes versus my co-workers.

Upvotes: 2

Views: 13048

Answers (2)

Milena Petrovic
Milena Petrovic

Reputation: 2771

The suggested solution with sys.objects can provide the information about the person who modified a stored procedure

I am trying to find my changes versus my co-workers.

This information is not available when using this query.To find your changes vs the changes your colleagues made, you can use:

  • a source control system
  • read the online transaction log to see who did what and when on your stored procedure

For the latter one, you can use the fn_dblog function, or a third party tool such as ApexSQL Log

Disclaimer: I work as a Product Support Engineer at ApexSQL

Upvotes: 3

charlesw
charlesw

Reputation: 612

You could try looking at the last modification date. If you know who was logged in to their system at the time it can help narrow down your suspects.

Credit goes to Chris Diver: How to check date of last change in stored procedure or function in SQL server

SELECT name, create_date, modify_date 
FROM sys.objects
WHERE type = 'P'

The type for a function is FN rather than P for procedure. Or you can filter on the name column.

Upvotes: 2

Related Questions