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
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Execute multiple scripts in SSMS

Author  Topic 

Oliver wang
Yak Posting Veteran

50 Posts

Posted - 2011-01-06 : 03:17:35
Hi Everyone,

I got a question here. Please think of the following scenario:
I create a query in SQL Server Management Studio, and put in one script like "select * from tablename". Then I copy this script ten times and put them in the same query. My question is:
1. Will these scripts be executed simultaneously or sequencially?
2. Are these scripts executed in the same connection or different connection?

Thank you very much in advance.

regards,

Oliver

Lumbago
Norsk Yak Master

3271 Posts

Posted - 2011-01-06 : 04:01:21
Why don't you give it a try?

1. Sequentially
2. The same connection

- Lumbago

My blog (yes, I have a blog now! just not that much content yet)
-> www.thefirstsql.com
Go to Top of Page

Lumbago
Norsk Yak Master

3271 Posts

Posted - 2011-01-06 : 04:03:01
Well...I have to elaborate a little on #1: they will all be sent to the database engine at the same time, but the engine will execute them sequentially in the order they are listed.

- Lumbago

My blog (yes, I have a blog now! just not that much content yet)
-> www.thefirstsql.com
Go to Top of Page

Oliver wang
Yak Posting Veteran

50 Posts

Posted - 2011-01-08 : 01:46:53
Thanks for your effort and support, Lumbago.
Go to Top of Page
   

- Advertisement -