views:

23

answers:

1

I have some valid select statements that when I send to MSSQL2005 sometimes return the error "Cursor not returned from Query".

It happens with different queries that work fine 99% of the time, and the only thing they all have in common is the use of several joins and some group by. Pretty standard queries.

How can I trace this and find out what's wrong?

Thanks

A: 

SQL Profiler can capture the SQL statements sent across the wire.

Capture the actual SQL sent and try running from SQL Server Management Studio.

How is your code executing the SQL statement(s)? I suspect that's where the problem is rather than the SQL itself.

Mitch Wheat