O'Reilly logo

Microsoft® SQL Server 2012 Unleashed by Alex T. Silverstein, Chris Gallelli, Paul T. Bertucci, Ray Rankins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Uncovering LINQ to SQL with LINQPad

You may be curious about the T-SQL that LINQ is generating for this .NET expression. To reveal this mystery, you can use two tools: SQL Server Profiler and LINQPad. To use Profiler, launch the application from Windows Start, create a new trace using the File menu (select New Trace), and connect to your database of choice. On the ensuing Trace Properties dialog, select the trace template called T-SQL_SPs, start the trace, and then run the LINQ statement found in Listing 47.3. The T-SQL that LINQ generates is revealed in the TextData column.

Alternatively, you can download and use the amazing, free LINQPad from http://www.LINQPad.net. Visit the site and download LINQPad4Setup.exe. Save it to a folder that you ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required