I have a stored procedure "glbl1_sp" that returns a table (or is it called a recordset - it's done with a select statement) with a bunch of columns - let's call them columns "a" through "q". I need only columns "a" and "b" dumped into a temp table. I cannot access that stored procedure "glbl1_sp". I am currently doing the following:
...but have a strong feeling that this is a highly inefficient way to do this. Is there some way to simply do something like "select a,b into ##temp_table from stored_proc"?
Thanks!
Deb
Code:
create table ##nat_acc_tbl(account_code varchar (50), account_description varchar (2000), c varchar (200), d varchar (200), e varchar (200), f varchar (200), g varchar (200), h varchar (200), i varchar (200), j varchar (200), k varchar (200), l varchar (200), m varchar (200), n varchar (200), o varchar (200), p varchar (200), q varchar (200))
insert into ##nat_acc_tbl exec glbl1_sp
alter table ##nat_acc_tbl drop column c,d,e,f,g,h,i,j,k,l,m,n,o,p,q
Thanks!
Deb