Simple way to see sql query command text?

Posts   
 
    
tvoss avatar
tvoss
User
Posts: 192
Joined: 07-Dec-2003
# Posted on: 30-Oct-2007 20:31:15   

Hello to everyone.

I've been using code like below successfully:

  'bFilter.Add(New FieldCompareSetPredicate(SamplerequestFields.Id, SampleresultFields.Sampleid, SetOperator.In, b1Filter, relations))

but when I made a minor change to b1Filter the query stopped working as expected.

To fix it I dropped the new fieldcomparesetpredicate's IN clause and just used some ORs instead and that worked, but I wish I knew why the IN didn't, since what I thought the resulting queries in SQL would be worked in TSQL, so...

Is there a simple way to see the resulting TSQL query command text that results from using these different command builder objects?

Did a search, but query was too general disappointed

TIA

DvK
User
Posts: 323
Joined: 22-Mar-2006
# Posted on: 30-Oct-2007 21:52:27   

See the docs : Generated code - Troubleshooting and debugging - Dynamic Query Engine tracing

Or

use the SQL Profiler and revert this SQL back to "readable" TSQL by using a somekind of tool.