Monday, February 27, 2012

How can I get the resultset from a stored procedure

I have a stored procedure which will output a table.
How can I use a sql statement to get the result of the sp?
Thanks a lot>I have a stored procedure which will output a table.
A stored procedure cannot output a table!
> How can I use a sql statement to get the result of the sp?
Get the result to where?
Roji. P. Thomas
Net Asset Management
https://www.netassetmanagement.com
"Vincent" <aaa@.aaa.com> wrote in message
news:u0SfhLYGFHA.2824@.tk2msftngp13.phx.gbl...
>I have a stored procedure which will output a table.
> How can I use a sql statement to get the result of the sp?
> Thanks a lot
>|||CREATE #TABLE (
define here the column according to the SP output format
)
INSERT INTO #TABLE EXEC my_sp
Chris
--
________________________________________
______
It's still better that if it would have been worst, isn't it ?
C'est toujours mieux que si c'etait pire !
"Vincent" <aaa@.aaa.com> wrote in message
news:u0SfhLYGFHA.2824@.tk2msftngp13.phx.gbl...
> I have a stored procedure which will output a table.
> How can I use a sql statement to get the result of the sp?
> Thanks a lot
>|||As a sample :
create table ##Test
(
SPID int,
ecid int,
status varchar(60),
loginame varchar(90),
hostname varchar (20),
blk int,
dbname varchar(30),
cmd varchar(100)
)
insert into ##test exec master.dbo.sp_who
________________________________________
______
It's still better that if it would have been worst, isn't it ?
C'est toujours mieux que si c'etait pire !
"Vincent" <aaa@.aaa.com> wrote in message
news:u0SfhLYGFHA.2824@.tk2msftngp13.phx.gbl...
> I have a stored procedure which will output a table.
> How can I use a sql statement to get the result of the sp?
> Thanks a lot
>|||Thank you very much
"Chris V." <tophe_news@.hotmail.com> wrote in message
news:eCbEYbYGFHA.2156@.TK2MSFTNGP10.phx.gbl...
> As a sample :
> create table ##Test
> (
> SPID int,
> ecid int,
> status varchar(60),
> loginame varchar(90),
> hostname varchar (20),
> blk int,
> dbname varchar(30),
> cmd varchar(100)
> )
> insert into ##test exec master.dbo.sp_who
>
> --
> ________________________________________
______
> It's still better that if it would have been worst, isn't it ?
> C'est toujours mieux que si c'etait pire !
> "Vincent" <aaa@.aaa.com> wrote in message
> news:u0SfhLYGFHA.2824@.tk2msftngp13.phx.gbl...
>

No comments:

Post a Comment