question

John 2 1 avatar image
John 2 1 asked

how to submit simultaneous commands in sql server

i need to execute or submit multiple commands at the same time without waiting for each command to complete in sql server 2000 or 2005. please help me.

sql-server-2005sql-server-2000
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Madhivanan avatar image
Madhivanan answered

Select all code and hit F5

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

TG avatar image
TG answered

Of course that will still execute the selected commands serially. For truly concurrent executions you would need to run different sessions - ie: multiple query windows. I don't know of a way to run concurrent code from the same window.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

graz avatar image
graz answered

In your client application you can create multiple threads and execute concurrent commands on different threads.

I would also look at BeginExecuteNonQuery and BeginExecuteReader for starting aysnc requests from the client.

http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.aspx

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.