Link SQL Server directly to external ODBC datasource

I am working to develop a procedure to pull data from an external ODBC datasource into a SQL Server 2008 R2 database.  I'm currently doing this via Access, since I started using Access with the external ODBC source and now have the need to move the data to SQL Server instead of Access.

However, my experience with SQL Server is somewhat limited, and I don't know how to link this external datasource directly to SQL Server so that I can bypass Access entirely for this process.

My eventual goal is to run a query that appends new data from the ODBC data source about once every hour.  I assume that this would be done with SSIS, and will probably be posting a question about that soon as well.

The machine SQL Server is running on contains the driver for the datasource and the connection string I'm currently using to connect Access to the ODBC source Looks like:

LVL 51
Dale FyeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

It is very easy. Open SSMS. Navigate to Server Objects->Linked Servers. Right click and select New Linked Server. Create the new server as per the image:
Linked ServerWhen the new server is created you can run the query like this:
SELECT * FROM OPENQUERY(CYGNET, 'Select * from tableInAccessDatabase')

Open in new window

Or using the following notation:
SELECT * FROM CYGNET...tableInAccessDatabase

Open in new window

(Please note that you need to use ... in the second example)
Just wanted to add. You can use sp_addlinkedserver to add the linked server via TSQL, like this:
USE [master]
EXEC master.dbo.sp_addlinkedserver 
    @server = N'GYGNET', 
    @provider= N'MSDASQL',

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Dale FyeAuthor Commented:
I think you misunderstood my intent.  I would like to take Access out of the mix entirely and link the tables in the Cygnet datasource directly to SQL Server.
In this case you need to import the tables to your SQL database
Dale FyeAuthor Commented:
Although this did not resolve the issue of the external ODBC connection, it did provide me with an answer to another issue, which is liking directly to an Access database.

Thanks for your help.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2008

From novice to tech pro — start learning today.