Depends on what you mean by debug. You can trap SQL errors with a
Try/Catch structure and in the Catch you can display the SQL error
with the Exception.Method property.
Yes you can. Search the MSDN help file for 'debug stored procedure' and
you'll find everything you need to know.
Briefly, you right-click on the stored procedure from the server explorer,
and select 'step into stored procedure'. Once you're in, you are prompted
for any input parameters and then can step through the procedure. You have a
locals window, a watch window, and can set break points and so forth.
One thing you'll probably have to do manually is give yourself execute
permissions on the master.sp_sdidebug stored procedure, which you'll find in
the extended stored procedures section in Enterprise Manager.
So far I haven't found any way to leave a breakpoint in the stored procedure
and have it hit from application code. It doesn't look like it's possible.
Tom Dacon
Dacon Software Consulting
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.