In this post we will discuss how to get stored procedure
text in sql server 2008. Also you can check out my previous posts on:
Recently I got a situation where I do not have permission to create or modify stored procedure, so I can not right click and click on modify to see the content of the stored procedure. But I need to check the stored procedure content. So I was looking for a query to get the content.
Below is the query:
SELECT object_definition(object_id('Stored Proccedure Name'))
AS [Object Definition];
SELECT object_definition(object_id('UserMaster_select')) AS StoredProcedureDetails
This Select statement will return the stored procedure as a Text.
The result will come like below: