<Mi*****************@gmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
Is there any better way to debug a query encased in IIF statements than
to find bugs at runtime? I have an especially ugly CommandText for one
of my datasets, and debugging it when there is an error is nearly
impossible. I realize that it's much cleaner when you have straight
SQL, but otherwise the tool doesn't seem to be very user-friendly.
Thanks,
Mike
I'm not sure exactly what you're working with - MSSQL doesn't have an IIF
function, and debugging a dataset (ADO.NET?) sounds like a client-side
operation, not a server-side one. If you mean you're building up a dynamic
query string for MSSQL using IIF, then you could use Profiler to see what it
eventually sends to the server, or just print out the final query string
before executing it. But you'll probably get a better response in an ADO or
client application group.
If this isn't helpful, or if I misunderstood your question, then I suggest
you post some more details about your environment and what you're trying to
achieve, perhaps with a (simplified) piece of code to show exactly what you
mean.
Simon