SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On



how to execute procedures one after the another in an script Expand / Collapse
Author
Message
Posted Wednesday, September 24, 2008 9:55 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, September 29, 2008 4:42 AM
Points: 6, Visits: 15
I have Script in which it contains one batch file followed by two procedures in it

my requirement is when we run script first batch file should run after completion of batch file run only it should go to 2nd ,3rd procedures

for example..

my script

declare @...

exec batch_file
exec proce2
exec proc 3


once completion of batch file execution the curosr should start execution of 2nd procedure
Post #575352
Posted Wednesday, September 24, 2008 11:21 AM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Today @ 6:52 AM
Points: 8,685, Visits: 4,956
I guess I don't understand the question. Stuff in a script is run in the order it's in the script.

If you have a batch, and then two procs, it will run the batch, and then run the two procs. In that order.


- GSquared

"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
Post #575434
Posted Thursday, September 25, 2008 3:55 AM


SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Today @ 7:03 AM
Points: 630, Visits: 871
My dear

your example will get executed as u desired bcoz execution is done in the same sequence as u write in your sql script


-------Bhuvnesh----------
While 1 = 1 (Learning SQL....)
For Quick Result:http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Speed up Databases Like Formula 1=http://www.brentozar.com/sql-server-training-videos/t-sql-performance-tuning-for-race-car-drivers/
Post #575819
« Prev Topic | Next Topic »


Permissions Expand / Collapse