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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Select from 2 DSN

Author  Topic 

pablodvn
Starting Member

1 Post

Posted - 2005-06-18 : 17:33:09
Hi, I need to make one select from two DSNs. I have two files .xls and I need one recordset from these.

Thank you

robvolk
Most Valuable Yak

15732 Posts

Posted - 2005-06-18 : 23:09:23
Not that SQL Server has anything to do with it, but you could possibly do this via linked servers. Create two linked servers, one for each DSN you have, and you should be able to use the following to give you one recordset via a SQL Server query:

SELECT * FROM OPENQUERY(Excel1, 'SELECT * FROM Sheet1')
UNION ALL
SELECT * FROM OPENQUERY(Excel2, 'SELECT * FROM Sheet1')


Excel1 and Excel2 are the names of your linked servers, change the query to match the actual linked server names.

For more information, refer to SQL Server Books Online under "linked servers". If you can provide more information on your environment and requirements you can post back here as well.
Go to Top of Page
   

- Advertisement -