View Single Post

   
  #3 (permalink)  
Old 05-11-2008, 09:41 PM
Plamen Ratchev
 
Posts: n/a
Default Re: Doing a SELECT INTO using a Stored Proc as the data source

You can use OPENQUERY, like:

SELECT * INTO #Tmp FROM OPENQUERY(Loopback, 'EXEC MySp');

Make sure to read Erland Sommarskog's article on some issues with this
approach:
http://www.sommarskog.se/share_data.html#OPENQUERY

Also, if you create the table structure first then you can use INSERT EXEC:

INSERT #Tmp EXEC MySp;

HTH,

Plamen Ratchev
http://www.SQLStudio.com

Reply With Quote