Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 ExecuteNonQuery Still Returns Data

Author  Topic 

stocks101
Starting Member

1 Post

Posted - 2010-02-03 : 12:41:42
I am writing an application that re-runs SQL trace data to test database changes. As part of this application, i want to send SQL statements back to the server, wait for them to execute and then run the next statement - but i am not interested in getting any data back as i will trace the results. If you imagine, there may be 100s of megs of data that i am not interested in the results for.

I run the queries using SqlCommand.ExecuteNonQuery which is fine and i get no results back from the actual call but, it still returns all of the resultset data to the client! You can see in TaskManager that it makes no difference to the amount of network data if i use ExecuteNonQuery or ExecuteReader. Internally (using Reflector), it looks like ExecuteNonQuery simply uses a reader anyway.

So, my question is this: is there a way to run the SQL on the server but not have any data returned to the client? My constraint is that i don't really want to affect the planning of the SQL on the server so need to keep any changes to a minimum (eg top, etc don't work here. Also, the SQL is typically executed using sp_executesql)

Many thanks

Environment is SQL 2k5, .NET 3.5

kirangentlebreeze1987
Starting Member

14 Posts

Posted - 2010-02-12 : 03:53:54
hey man how executenonquey returns data to the client???it is impossible...

kkk
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-02-12 : 04:44:23
I don't know the answer to your question, sorry. But if you are running a regression test don't you need to check that the data that comes back is the same as before? The SQL may parse, compile, run ... but return completely different / incorrect data ??
Go to Top of Page
   

- Advertisement -