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 |
|
jggtz
Starting Member
32 Posts |
Posted - 2008-06-23 : 11:07:19
|
| MS SQL 2005I developed several SP that update tablesIf I execute them one by one in the SQL Sever Management Studio, they work okNow, I want to execute them all inside another SPI wrote it (attached code)Execute it and give me a message that runs successfully but that is not trueMay anyone of You tell me the right syntax to do it?[Code]USE REPORTESGOSET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOCREATE PROCEDURE dbo.Astral_sp_AcumulaAS--EXECUTE [REPORTES].[dbo].[Astral_sp_AcCpasArtC]GOEXECUTE [REPORTES].[dbo].[Astral_sp_AcDevArtC]GOEXECUTE [REPORTES].[dbo].[Astral_sp_AcVtasArtV]GO-- More sp executions[Code]Thanks JG |
|
|
jdaman
Constraint Violating Yak Guru
354 Posts |
Posted - 2008-06-23 : 11:29:49
|
| Try removing the GO statements when creating the parent sp like so:USE REPORTESGOSET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOCREATE PROCEDURE dbo.Astral_sp_AcumulaAS--EXECUTE [REPORTES].[dbo].[Astral_sp_AcCpasArtC]--GOEXECUTE [REPORTES].[dbo].[Astral_sp_AcDevArtC]--GOEXECUTE [REPORTES].[dbo].[Astral_sp_AcVtasArtV]--GO-- More sp executionsRead more about the GO statement here to understand better why your original code was not working as you intended: http://msdn.microsoft.com/en-us/library/ms188037.aspx |
 |
|
|
jggtz
Starting Member
32 Posts |
Posted - 2008-06-23 : 14:55:00
|
| Thanks for your replyThe problem seems to be in the SP's I'm trying to ExecutePlease look new topic titled 'Stored Procedure syntax problem' submited by me where I explain why I use GO'sJG |
 |
|
|
|
|
|