Pages

Friday, April 6, 2012

Don’t let fancy CLR debugging slow you down

There are a number of tools you can use for debugging CLR integration code in Visual Studio, such as the test.sql page and a special CLR debugger. Unfortunately, each new tool comes with its own quirks and setup headaches. Our recommendation is to avoid using these fancy tools unless you need to troubleshoot why something that works in Visual Studio doesn’t work when you deploy it to SQL Server.

Instead of relying on complex debugging setups, write your modules and classes in a regular project in Visual Studio and debug them there. Make sure your SQL Server stored procedures and functions are very simple; they only need to be a few lines. In those lines, you can call procedures in your modules and classes, where you do the serious work. Architecting your code this way makes code reuse much easier—as well as keeping you from having to debug more tools just to debug your code

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.