Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Site Related Forums
 The Yak Corral
 SProc Resultset Columns - Dynamically

Author  Topic 

Kristen
Test

22859 Posts

Posted - 2005-08-22 : 14:50:17
I'm sure one of the regulars here came up with a crafty way of working out what the return resultset column names/datatypes were.

But I'll be damned if I can find the relevant thread :-(

If it was you can you provide a link in this thread pls

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=53939

Cheers!

Kristen

nr
SQLTeam MVY

12543 Posts

Posted - 2005-08-23 : 14:03:53
sql?
select * into #tbl from openquery(myserver,'exec mydb..myproc')or openrowset

but it creates a new connection so is a bad idea.

If it doesn't use temp tables you can call the sp with set fmtonly on so it doesn't return a resultset

select * into #tbl from openquery(myserver,'set fmtonly on exec mydb..myproc')


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

rockmoose
SQL Natt Alfen

3279 Posts

Posted - 2005-08-23 : 14:50:58

On another thread !!!

rockmoose
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2005-08-24 : 08:10:32
Thanks guys

Kristen
Go to Top of Page
   

- Advertisement -