June 10, 2003 at 12:53 am
Hi!
Suppose we have a stored procedure (for example : sp_helplogins)
When we run it:
sp_helplogins 'domain.local\Ivanov'
It returns a record set(sets):
LoginName,SID,DefDBName,DefLangName,AUser,ARemote
domain.local\Ivanov,0x0105000000000005150000009332C47F2F57EC683723162FAC120000,master,us_english,yes ,no
(1 row(s) affected)
LoginName,DBName,UserName,UserOrAlias
domain.local\Ivanov,DB1,Ivanov,User
domain.local\Ivanov,DB2,Ivanov,User
...
How can we place this info into a temp table or a cursor?
Thanx.
June 10, 2003 at 12:58 am
INSERT #Temp(ColName1, ColName2 etc etc) exec @vSPName (Params for SP)
Cheers,
Crispin
Cheers,CrispinI can't die, there are too many people who still have to meet me!It's not a bug, SQL just misunderstood me!
June 10, 2003 at 1:05 am
What if it returns two or more record sets, like sp_helplogins?
June 11, 2003 at 3:12 pm
I wouldn't now how to handle the multiple recordsets. My advice would be to copy the portion out of sp_helplogins that creates only the output you desire and create a new stored procedure.
-Ken
June 17, 2003 at 4:14 am
Hi, I am trying populate a temporary table by a SP as follows
Insert Into #test execute PEP_GetPromotion 'C ', '009904ML', '130', 'P0', 'Search_ProdHome101234_38483', 'P'
I always get the following error : Invalid object name '#test'.
Thanks for your help (I even tried the example in BOL and had the same error)
June 17, 2003 at 4:17 am
Does the table exist? Before you do the insert, try select * From #Test.
Are you creating the table and the building up a string with the insert syntax?
If so, this should not work.
Cheers,
Crispin
Cheers,CrispinI can't die, there are too many people who still have to meet me!It's not a bug, SQL just misunderstood me!
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply