When EF or LINQ to SQL runs a query, it:
In Linq2SQL you can use:
var cmd = DataContext.GetCommand(expression); var sqlQuery = cmd.CommandText;