Wednesday, January 8, 2014

SQL Server Proxy Tables Via DSN-Less Connections

Question: How do I set up a DSN-less connection to a SQL Server database for the purpose of using proxy tables?

Answer: Creating and maintaining ODBC DSNs is a real pain in the [redacted]; using a DSN-less connection is actually quite easy:

CREATE SERVER mss 
   CLASS 'MSSODBC' 
   USING 'Driver=SQL Server Native Client 10.0; Server=Envy; Database=test; Trusted_Connection=yes;';

CREATE EXISTING TABLE proxy_t AT 'mss.test.dbo.t';

SELECT * FROM proxy_t;

       pkey        data 
----------- ----------- 
          1           1 
You can read about SQL Anywhere proxy tables here:
Remote data access
and SQL Server Trusted Connections here:
Choose an Authentication Mode


No comments: