Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Finding Stored Procedures

Author  Topic 

nweiher1
Starting Member

1 Post

Posted - 2012-02-08 : 12:58:52
How does one get access to stored procedures for a SQL database? We had an ex-employee who wrote a bunch of stored procedures. When he left, he didn't let anyone know where they are or what they were named!

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2012-02-08 : 13:06:42
In SQL Server Management Studio, in Object Explorer, open the Server -> DatabaseName -> Programmability -> Stored Procedures node.

You should be able to right-click on any stored proc and script it to see the code (unless it is encrypted).
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-02-08 : 14:07:23
or just check

select definition from sys.sql_procedures p
inner join sys.objects o
on o.object_id = p.object_id
where USER_NAME(OBJECTPROPERTY(o.object_id, 'OwnerId')) = <the owner name>
AND o.type='P'


------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -