
160
|
Chapter 5, Debugging
#40 Debug SQL Server
HACK
You cannot run triggers directly, but you can set breakpoints in triggers, and
if they are triggered, Visual Studio will break into their execution on those
breakpoints.
Running Remote
You can configure Visual Studio and SQL Server to debug stored proce-
dures and functions that are located on a remote server. Enabling this has
security implications, and I would not recommend it on a production SQL
Server. The process for enabling this feature includes quite a few steps,
which are detailed at http://msdn.microsoft.com/library/default.asp?url=/
library/en-us/vsdebug/html/vxlrfSettingUpSQLDebugging.asp.
Being able to debug T-SQL stored procedures, functions, and triggers can be
extremely helpful when trying to find errors or follow the execution of your
application.
Figure 5-24. Debugging a stored procedure
Figure 5-25. Locals window