Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stored Proc calling MULTIPLE Stored Procs

Status
Not open for further replies.

bsingin64

IS-IT--Management
Oct 24, 2001
63
US
I am attempting to call 3 stored procedures from within a stored procedure.

We'll call them SP_Master, SP_Step1, SP_Step2, SP_Step3

Each individual SP works ( SP_Step1, SP_Step2, SP_Step3)
and will all run in succession in one line in the query anylizer using the word "GO" between each.

When i run them using SP_Master, the query optimizer tries to make an execution plan that puts them out of order. I need them to run sequentially 1-2-3, because 1 does things to the tables that 2 needs to be done, before 3 can happen.

I'm thinking this has somthing to do with the execution plan.

My question is, is it possible to force the execution plan to NOT optimize a query, or does anyone know a way to get my SP to work in sequence. Brandon W
 
Have you tried this
Begin
Exec SP_Step1
end
Begin
Exec SP_Step2
end
Begin
Exec SP_Step3
end

I never had, just a guess.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top