Linq to SQL Debug Visualizer

I have been learning Linq for sometime. However I always had some difficulty figuring out what SQL statement got generated for my Linq query. Although there are numerous ways to find the SQL statement that get generated but none of them were with out code or having to leave visual studio environment. Last week I discovered a really good tool called Linq to SQL Visualizer which allows me look at my Linq query in a Visualizer that exactly shows the SQL statement generated. It also allows you to execute your query from there as well.

You can download Linq to SQL Visualizer over here

http://www.scottgu.com/blogposts/linqquery/SqlServerQueryVisualizer.zip

Unfortunately Linq to SQL is not part of visual studio 2008. The Visualizer has to be downloaded separately.

Once you have downloaded and extracted the sqlQueryVisualizer, you have to copy SqlServerQueryVisualizer.dll from bin/debug directory onto

C:\Program Files\Microsoft Visual Studio 9.0\Common7\Packages\Debugger\Visualizers

Before copying the dll, make sure that you have all instances of visual studio shutdown.

After copying the dll, when you hover over  Linq to SQL query, you will get a magnifying glass and clicking on it will open the SQL Visualizer. Here is how the screen shot looks like.

 SQL Server Query Visualizer

 

You also have the option of executing the query from there and also seeing the results.

Published Wednesday, April 30, 2008 12:48 PM by zhirani

Comments

# re: Linq to SQL Debug Visualizer

Wednesday, April 30, 2008 7:17 PM by Zeeshan Hirani

cool! I did not know about it.

Thanks

# re: Linq to SQL Debug Visualizer

Tuesday, December 7, 2010 11:25 AM by drake71

Is a rollout date available yet for when an updated version of LINQ to SQL Debug Visualizer will be available that works with Visual Studio 2010?