How do I call a stored proc from inside another stored proc 
Author Message
 How do I call a stored proc from inside another stored proc
Mike, Use EXEC
--
HTH,
Vyas
http://www.***.com/
SQL Server 7.0 Replication FAQ and commonly encountered problems:
http://www.***.com/
Interesting code samples (SQL stored procedures, VB programs):
http://www.***.com/
Preparing for a DBA/DB Developer interview? Check out the interview questions:
http://www.***.com/

*** Sent via Developersdex http://www.***.com/ ***
Don't just participate in USENET...get rewarded for it!



Sun, 16 Nov 2003 03:26:21 GMT
 How do I call a stored proc from inside another stored proc

Is it possible to call a stored proc from inside another stored proc in SQL
Server 6.5.  If so how is it done?

Thank You
Mike



Sun, 16 Nov 2003 03:12:25 GMT
 How do I call a stored proc from inside another stored proc
In SQL 7.0 and later, this is accomplised via the syntax:



I don't have any direct experience with SQL 6.5, but this might be worth a
try.


Quote:
> Is it possible to call a stored proc from inside another stored proc in
SQL
> Server 6.5.  If so how is it done?

> Thank You
> Mike



Sun, 16 Nov 2003 03:51:10 GMT
 How do I call a stored proc from inside another stored proc
here are two scripts.

one calls the other.  without declaring a return result.

..

code below
--START CODE

use pubs

if exists (select * from sysobjects where id =
object_id('dbo.usp_10_return_authors_upperlevel') and sysstat & 0xf = 4)
 drop procedure dbo.usp_10_return_authors_upperlevel
GO

Create PROC usp_10_return_authors_upperlevel


AS



return
GO

--END CODE

--START CODE 2

use pubs

if exists (select * from sysobjects where id =
object_id('dbo.usp_10_return_authors') and sysstat & 0xf = 4)
 drop procedure dbo.usp_10_return_authors
GO

Create PROC usp_10_return_authors


AS

SET NOCOUNT ON





--START TEMP TABLE CODE
CREATE TABLE #tableDataHolder(x varchar(64) PRIMARY KEY)
INSERT INTO #tableDataHolder(x) VALUES ('manual entry')
INSERT INTO #tableDataHolder(x) (select distinct au_lname from authors where


drop table #tableDataHolder
--END TEMP TABLE CODE

--START NON TEMP TABLE CODE
--next line is commented right now.  uncomment it if you comment out all the
code between "--START TEMP TABLE CODE" and "--END TEMP TABLE CODE" lines

--END NON TEMP TABLE CODE

GO

--END CODE 2

Quote:

> In SQL 7.0 and later, this is accomplised via the syntax:



> I don't have any direct experience with SQL 6.5, but this might be worth a
> try.



> > Is it possible to call a stored proc from inside another stored proc in
> SQL
> > Server 6.5.  If so how is it done?

> > Thank You
> > Mike



Sun, 16 Nov 2003 22:56:24 GMT
 
 [ 4 post ] 

 Relevant Pages 

1. creating a stored proc from inside another stored proc

2. Calling a Stored proc within a stored proc

3. a stored proc calling another stored proc

4. Calling stored proc from stored proc

5. calling stored proc from stored proc via variable

6. Need Help on Dynamic Stored Proc Call within Stored Proc w/OUTPUT

7. Using a stored proc to call another stored proc

8. Calling another stored proc within a stored proc

9. Calling Stored Proc from another Stored Proc

10. How to call a stored Proc or Ext Stored proc /T-SQL UDF from VBScript

11. Stored Proc Calling Another Stored Proc

12. Calling a stored proc within a stored proc


 
Powered by phpBB® Forum Software