June 17, 2005 at 11:57 am
I am using an openrowset function to get values from a server as
SELECT a.*
FROM OPENROWSET('SQLOLEDB','myserver';'sa';'MyPass',
'SELECT * FROM pubs.dbo.authors ORDER BY au_lname, au_fname') AS a
GO
whatvere gets returned from here can this be stored into a variable. Anyone ha a better idea about this?
Thanks
June 17, 2005 at 12:38 pm
Have you tried doing an INSERT INTO #Table with the same schema as your openrecordset?
INSERT INTO #Table (field1, field2, field3)
SELECT a.field1, field2, field3
FROM OPENROWSET('SQLOLEDB','myserver';'sa';'MyPass',
'SELECT field1, field2, field3 FROM pubs.dbo.authors ORDER BY au_lname, au_fname') AS a
Good Hunting!
AJ Ahrens
webmaster@kritter.net
June 17, 2005 at 12:46 pm
Or try table variable
DECLARE @tblvar(...)
INSERT INTO @tblvar
SELECT ....
Vasc
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply