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 |
|
ben_53
Yak Posting Veteran
67 Posts |
Posted - 2011-08-31 : 15:21:51
|
| Hi guys, I have 10 stored procedures and I need to run these 10 stored procedures in one SP.I am trying to nest them up but unable. The script Im using is :IF NOT EXISTS(SELECT id FROM sysobjects WHERE id = object_id('dbo.Main_sp')) EXECUTE ('CREATE procedure dbo.Main_sp AS SELECT 0 AS temp')GOALTER PROCEDURE dbo.Main_spASBEGIN/*** EXECUTE SP1 ***/ IF NOT EXISTS(SELECT id FROM sysobjects WHERE id = object_id('dbo.sp1')) EXECUTE ('CREATE procedure dbo.sp1 AS SELECT 0 AS temp')ALTER PROCEDURE dbo.sp1AS..........END /*** same for 2 -10 ***/ENDNested stored procedures wont run. please help me correct the code. Thanks in advance. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-09-01 : 00:02:51
|
| I really cant understand why someone would want to do this? Can you explain what you're trying to achieve by above dynamic sp code?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|