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
 Old Forums
 CLOSED - General SQL Server
 Linked Server to access SAS data

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-05-16 : 09:44:04
Serguei writes "Hello,

How to create a linked server in SQL Server 2000 to access SAS data ?

What's available:
SAS v8.2
SAS ODBC driver
SQL Server 2000 SP2

Note:
MS Access and MS Excel are getting SAS data fine. However I've not been able to get SAS data from within SQL Server.

Any ideas, code samples are highly appreciated.
Serguei"

phconrad
Starting Member

12 Posts

Posted - 2003-05-16 : 10:16:36
I'm doing a similar thing I believe with FoxPro.

First I set up a DSN to connect to my FoxPro db. Then I created the Linked Server in SQL Svr 2K like this:

--*** Create Linked Server ***
USE master
GO

parameter
EXEC sp_addlinkedserver
@server = 'Linked_Svr_Name',
@srvproduct = '',
@provider = 'MSDASQL',
@datasrc = 'DSN_Name'
GO


Then, I actually used the linked server and created a view to access the data from:


--*** Create View ***
CREATE VIEW dbo.vw_Test
AS
SELECT *
FROM OPENQUERY(Linked_Svr_Name, 'SELECT col1, col2, col3 FROM table
WHERE col1 > 0
')
GO

Hope this helps.

Go to Top of Page
   

- Advertisement -