Is it possible to output the SQL generated by the Entity Framework on a global level and not on a query by query basis? I'm looking to just dump it all somewhere so I can review it.
If that is not possible, how do I view the SQL being generated for updates and inserts?
The SQL Server Profiler will allow you to view the commands that are being executed on the server while the application is running.
Another free tool for profiling SQL Server 2005 Express here.
Another method to see what is being generated by LINQ is the Log property of the DataContext.
It is a TextWriter that should be easy to save the contents to a file or redirect to Console.Out.
MSDN Info for Log property
you want LinqPad, here are some videos that show you how to use it
Since this was originally asked, you can also now use EFProf to profile your Entity Framework application, which allows you to see the SQL Generated among many other metrics.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With