Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Test a stored procedure in Microsoft Sql Server Management Studio

Tags:

sql

ssms

How can you test an existing stored procedure in Microsoft Sql Server Management Studio?

like image 599
MBU Avatar asked Mar 10 '11 23:03

MBU


1 Answers

Not sure of best approach here is how I do it:

You can right click the sp > tasks > execute to > new query window. This will allow you to call the SP with parameters.

You can then do selects at various points in the SP for debugging.

The other way if it is a really complex SP is to take the code out of an SP and just declare variables in place of the parameters then you can just run the TSQL code directly.

Would love to hear any better ways though.

like image 186
Burt Avatar answered Oct 17 '22 16:10

Burt