Click here to Skip to main content
15,897,291 members
Articles / Programming Languages / SQL

See the SQL Generated by LINQ

Rate me:
Please Sign up or sign in to vote.
5.00/5 (6 votes)
8 Apr 2011CPOL 13.1K   3  
Or, there's always Scott Guthrie's LINQ To SQL Debug Visualizer[^].[Edit]While I'm posting links there is a nice utility that can output the generated SQL to the Debug Window in VS written by Kris Vandermotten.You can get it here[^].To use it: MyDataContext db = new...

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

Please Sign up or sign in to vote.
17 Jul 2011Philippe Mori
LINQPad is an interesting tool to try queries.LINQPad[^]Perfect tool to try out some alternatives for complex queries. As we can see generated queries and elapsed time, it help a lot to help having fast queries for complex requests.
Please Sign up or sign in to vote.
18 Jul 2011AspDotNetDev
If you are the type that likes to debug production code, you can use SQL Profiler to find queries generated by your LINQ statements. This is a technique I recently used because it was so simple and did not require me to recompile anything.Note that StefanHam already posted this alternate...
Please Sign up or sign in to vote.
26 Feb 2010MarkLTX 3 alternatives  
When using LINQ to SQL, it can be very useful to see the SQL commands that are generated by your LINQ expressions. Sometimes the results are surprising and you might be able to improve performance by tweaking the LINQ.All you have to do is set the Log property of the DataContext object. ...

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Retired
United Kingdom United Kingdom
Retired Systems Admin, Programmer, Dogsbody.
Mainly on Systems for Local Government, Health Authorities,
Insurance Industry - (COBOL eeeeeeeugh).
Inventor of Synchronized Shopping.

Comments and Discussions