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.
Author |
Topic |
ganeshkumar08
Posting Yak Master
187 Posts |
Posted - 2012-01-18 : 06:39:18
|
Hi All,I need a clarification from you all.For Ex: Select * From table1;Select * from Table2;Select * from Table3;if you execute the above all statements, the sql will execute one by one. My doubt is is it possible to do parallel execution.i.e, we need to split it and execute parallel. Select All above 3 statements and press F5, the sql should start executing 3 statement in same time. It is like Thread concept in Java/Dot Net. Is it Possible in SQL?? Please clarify it.ThanksGaneshSolutions are easy. Understanding the problem, now, that's the hard part |
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-01-18 : 06:56:04
|
I am not aware of a feature within T-SQL that would be the equivalent of spawning a new thread in Java/.Net. However, depending on your server setting a single statement may be executed in parallel. You can control the degree of parallelism via the MAXDOP query hint. http://msdn.microsoft.com/en-us/library/ms181714.aspx |
 |
|
ganeshkumar08
Posting Yak Master
187 Posts |
Posted - 2012-01-19 : 05:50:25
|
Actually I want to execute below SQL script fro every 2 hours.XEC AKEBONO50.DBO.ALL_EXPIRECOURSESTATUS '2443377';EXEC ALAMOGROUP50.DBO.ALL_EXPIRECOURSESTATUS '27401';EXEC ALLSTATE50.DBO.ALL_EXPIRECOURSESTATUS '299089';EXEC ALMADG50.DBO.ALL_EXPIRECOURSESTATUS 'ALMADG';EXEC AMCORRP50.DBO.ALL_EXPIRECOURSESTATUS '1717229';EXEC AMERICALATINA50.DBO.ALL_EXPIRECOURSESTATUS 'AMERICALAT';EXEC AP50.DBO.ALL_EXPIRECOURSESTATUS 'DUPONTPI';Since the above statement take more time to execute. Now i want it to split and start execution all at a same time. Is it possible to do it???Solutions are easy. Understanding the problem, now, that's the hard part |
 |
|
jackv
Master Smack Fu Yak Hacker
2179 Posts |
Posted - 2012-01-19 : 08:12:25
|
Service Broker allows multi thread like managementJack Vamvas--------------------http://www.sqlserver-dba.com |
 |
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-01-19 : 08:16:01
|
What are you using to trigger the job every two hours? If you are using SQL Agent, you can set up separate jobs for each task. If you are doing it from a client application, you can open separate connections and run each task. |
 |
|
|
|
|