• subscribe
April 20, 2004 12:00 AM

T-SQL and SQL CLR Debugging

SQL Server Pro
InstantDoc ID #42211

Testing the Common Language Runtime (CLR) code for my example application was difficult until I discovered the new magic key for enabling cross-process debugging. The upcoming Visual Studio 2005 release includes an Attach to Process dialog box in the Debug menu, which replaces the Debug Process menu in Visual Studio .NET 2003. The Attach to Process dialog box links the Visual Studio 2005 IDE to the SQL Server running the stored procedure. For this example, I wanted to link to one of two SQL Servers—my development system was running both SQL Server 2000 Developer Edition and SQL Server 2005. The Attach to Process dialog box lists all the running processes, so you need to scroll down in the list to locate the sqlservr.exe process that shows the type SQL, .NET, Win32. (The SQL Server 2000 process doesn't include .NET in the type.) After you choose a process, click Attach to switch the IDE to run mode. Now, if you've set a breakpoint and the CLR stored procedure executes from the SQL Server Management Studio IDE, Visual Studio 2005 will break at the specified point—assuming the CLR logic gets to that point. Watch out—problems might occur if you wait too long in break mode because the server can timeout while waiting for the command to complete.



ARTICLE TOOLS

Comments
    There are no comments to display. Be the first one!
You must log on before posting a comment.

Are you a new visitor? Register Here
  • SP1?
    I know there is a SP1 for SQL 2008 R2 available....and there is a "feature pack" as well... ...
  • SQL database mirroring
    I have SQL Server 2008 R2 Enterprise 64bit on Windows 2008 R2 Enterprise 64bit.  Each SQL Server has...
  • Dell Compellent Disk Drive
    Does anybody has experience with Dell Compellent Disk Drive? Basically, this system manages all disk...
  • Sql server performance tuning
    I need to find a tool that help me to optimize sql server,queries,improve the performance and solve ...