Board index » delphi » Calling a stored procedure in another stored procedure in SQL Server 7.0

Calling a stored procedure in another stored procedure in SQL Server 7.0

Hello, I'm an ACCESS user and I'm migrating an ACS Database to SQL
SERVER. I want to create a S.P. (A) that uses another S.P. (B). In
Access, you just use the name of the S.P. A as if it was a TABLE, it
appears that in SQL S, it is not the case. I tried to add them
parameters like SELECT * FROM A(@1,@2) but it does not work either,
could you please help me ???

Thanks a lot

Habib

 

Re:Calling a stored procedure in another stored procedure in SQL Server 7.0


Quote
SAID LAACHRATE <laachr...@freesurf.fr> wrote in message

news:3854C2B4.C741E588@freesurf.fr...

Quote
> Hello, I'm an ACCESS user and I'm migrating an ACS Database to SQL
> SERVER. I want to create a S.P. (A) that uses another S.P. (B). In
> Access, you just use the name of the S.P. A as if it was a TABLE, it
> appears that in SQL S, it is not the case. I tried to add them
> parameters like SELECT * FROM A(@1,@2) but it does not work either,
> could you please help me ???

> Thanks a lot

> Habib

Hi Habib

you can do that like :

Declare @InputParam Int,
             @OutPutParam Int

Select @InputParam=...
EXECUTE MyStoredProc @InputParam , @OutPutParam OUTPUT

Mohamed

Re:Calling a stored procedure in another stored procedure in SQL Server 7.0


Habib,

create table t ( ... )
go

insert into t
exec A @P1, @P2

select * from t

This requires that you know the output of the stored procedure ahead of time
so that you can create table t to hold the result set of the stored
procedure.

Quote
SAID LAACHRATE <laachr...@freesurf.fr> wrote in message

news:3854C2B4.C741E588@freesurf.fr...
Quote
> Hello, I'm an ACCESS user and I'm migrating an ACS Database to SQL
> SERVER. I want to create a S.P. (A) that uses another S.P. (B). In
> Access, you just use the name of the S.P. A as if it was a TABLE, it
> appears that in SQL S, it is not the case. I tried to add them
> parameters like SELECT * FROM A(@1,@2) but it does not work either,
> could you please help me ???

> Thanks a lot

> Habib

Other Threads