Re: Execute a stored procedure and place results in a temporary table
From: Vishal Parkar (REMOVE_THIS_vgparkar_at_yahoo.co.in)
Date: 02/24/04
- Previous message: Alastair Bell: "Execute a stored procedure and place results in a temporary table"
- In reply to: Alastair Bell: "Execute a stored procedure and place results in a temporary table"
- Next in thread: Alastair Bell: "Re: Execute a stored procedure and place results in a temporary table"
- Reply: Alastair Bell: "Re: Execute a stored procedure and place results in a temporary table"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 24 Feb 2004 23:32:18 +0530
hi alastair,
--Two methods
1) you will have to create a table first and then insert output of stored procedure using
following syntax.
insert into <table> exec <stored_procedure>
create table #t(
spid int null,
ecid int null,
status varchar(500) null,
loginname varchar(500) null,
hostname varchar(500) null,
blk int null,
dbname sysname null,
cmd varchar(800) null)
insert into #t exec sp_who
2) without precreating the table you will have something as follows
EXEC sp_serveroption <server name>, 'data access' , 'true'
select *
into #temptable
from openquery (<server name>, 'exec sp_who')
-- Vishal Parkar vgparkar@yahoo.co.in
- Previous message: Alastair Bell: "Execute a stored procedure and place results in a temporary table"
- In reply to: Alastair Bell: "Execute a stored procedure and place results in a temporary table"
- Next in thread: Alastair Bell: "Re: Execute a stored procedure and place results in a temporary table"
- Reply: Alastair Bell: "Re: Execute a stored procedure and place results in a temporary table"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|