<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: SQL Server 2012 Remote connection through SAS ODBC in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SQL-Server-2012-Remote-connection-through-SAS-ODBC/m-p/269075#M53297</link>
    <description>&lt;P&gt;In theory it should be just the same so I suggest you persevere with your current setup. Also I didn't quite get the LIBNAME right (should specify ODBC engine):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname SQLServr odbc noprompt = 'DRIVER=SQL Server;server=123.456.789;user=MyUser;password=MyPassword' database = MyDatabase schema = dbo;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Does this help? Does the LIBNAME assign and appear in your library window?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 08 May 2016 19:52:24 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2016-05-08T19:52:24Z</dc:date>
    <item>
      <title>SQL Server 2012 Remote connection through SAS ODBC</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-Server-2012-Remote-connection-through-SAS-ODBC/m-p/268699#M53206</link>
      <description>&lt;P&gt;Can someone tell me the code&amp;nbsp;to connect to SQL Server remotely through&amp;nbsp;SAS ODBC so that I can see the schema as well?&lt;/P&gt;
&lt;P&gt;I have the IP Addesss, User ID and Password.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do I also have to set up something at Control Panel\All Control Panel Items\Administrative Tools\Data Source (ODBC)?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Mike&lt;/P&gt;</description>
      <pubDate>Thu, 05 May 2016 23:48:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-Server-2012-Remote-connection-through-SAS-ODBC/m-p/268699#M53206</guid>
      <dc:creator>mlogan</dc:creator>
      <dc:date>2016-05-05T23:48:55Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Server 2012 Remote connection through SAS ODBC</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-Server-2012-Remote-connection-through-SAS-ODBC/m-p/268748#M53220</link>
      <description>&lt;P&gt;Are you using SAS on your PC to connect to SQL Server or are you using a remote SAS Server? In either case if SAS is running on Windows you can avoid the Control Panel setup by specifying everything in a database connection string.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is your database userid and password your Windows user account and password or are they different? The reason I ask is its very common to connect to SQL Server using Windows Authentication (your connection is verified using your Windows user account).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The one thing you are missing at the moment is you need the name of a database to connect to.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then you can construct a test LIBNAME like this (please note syntax may not be quite right as I'm doing this from memory):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname SQLServr noprompt = 'server=123.456.789;user=MyUser;password=MyPassword' database = MyDatabase schema = dbo;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Once you've confirmed the above questions I can give you a more accurate answer.&lt;/P&gt;</description>
      <pubDate>Fri, 06 May 2016 08:08:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-Server-2012-Remote-connection-through-SAS-ODBC/m-p/268748#M53220</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2016-05-06T08:08:51Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Server 2012 Remote connection through SAS ODBC</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-Server-2012-Remote-connection-through-SAS-ODBC/m-p/268837#M53257</link>
      <description>Hi SASKiwi,&lt;BR /&gt;I am using SAS on my PC. Server UserID and Password is different than my windows.&lt;BR /&gt;&lt;BR /&gt;I used your code, it went through successfully, but I don't see any library name on the left though. Can you please elaborate a bit more so that I can extract data from here. Thanks,</description>
      <pubDate>Fri, 06 May 2016 15:57:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-Server-2012-Remote-connection-through-SAS-ODBC/m-p/268837#M53257</guid>
      <dc:creator>mlogan</dc:creator>
      <dc:date>2016-05-06T15:57:53Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Server 2012 Remote connection through SAS ODBC</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-Server-2012-Remote-connection-through-SAS-ODBC/m-p/269040#M53294</link>
      <description>&lt;P&gt;OK, since you are connecting from your PC that means you can specify everything to connect to SQL Server in a connection string. Also I forgot to add the DRIVER option in my previous post so it is not surprising it is not working for you. I can check this better at work but that won't be until tomorrow.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the LIBNAME works OK then the library name should appear in the library list and expanding it should show tables.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname SQLServr noprompt = 'DRIVER=SQL Server;server=123.456.789;user=MyUser;password=MyPassword' database = MyDatabase schema = dbo;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 08 May 2016 00:08:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-Server-2012-Remote-connection-through-SAS-ODBC/m-p/269040#M53294</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2016-05-08T00:08:20Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Server 2012 Remote connection through SAS ODBC</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-Server-2012-Remote-connection-through-SAS-ODBC/m-p/269042#M53295</link>
      <description>Hi SASKiwi,&lt;BR /&gt;My SQL Server is sitting in a virtual machine. If it is that complicated to connect remotely, I can always install SQL Server on my local pc (where SAS is installed). Do you think that will be a better solution for me?</description>
      <pubDate>Sun, 08 May 2016 02:17:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-Server-2012-Remote-connection-through-SAS-ODBC/m-p/269042#M53295</guid>
      <dc:creator>mlogan</dc:creator>
      <dc:date>2016-05-08T02:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Server 2012 Remote connection through SAS ODBC</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-Server-2012-Remote-connection-through-SAS-ODBC/m-p/269075#M53297</link>
      <description>&lt;P&gt;In theory it should be just the same so I suggest you persevere with your current setup. Also I didn't quite get the LIBNAME right (should specify ODBC engine):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname SQLServr odbc noprompt = 'DRIVER=SQL Server;server=123.456.789;user=MyUser;password=MyPassword' database = MyDatabase schema = dbo;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Does this help? Does the LIBNAME assign and appear in your library window?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 08 May 2016 19:52:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-Server-2012-Remote-connection-through-SAS-ODBC/m-p/269075#M53297</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2016-05-08T19:52:24Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Server 2012 Remote connection through SAS ODBC</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-Server-2012-Remote-connection-through-SAS-ODBC/m-p/269290#M53343</link>
      <description>Hi SASKiwi,&lt;BR /&gt;I tried the code and I get the following error. &lt;BR /&gt;&lt;BR /&gt;ERROR: CLI error trying to establish connection: [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL&lt;BR /&gt;       Server does not exist or access denied. : [Microsoft][ODBC SQL Server&lt;BR /&gt;       Driver][DBNETLIB]ConnectionOpen (Connect()). : [Microsoft][ODBC SQL Server Driver]Invalid&lt;BR /&gt;       connection string attribute&lt;BR /&gt;ERROR: Error in the LIBNAME statement.</description>
      <pubDate>Tue, 10 May 2016 00:15:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-Server-2012-Remote-connection-through-SAS-ODBC/m-p/269290#M53343</guid>
      <dc:creator>mlogan</dc:creator>
      <dc:date>2016-05-10T00:15:00Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Server 2012 Remote connection through SAS ODBC</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-Server-2012-Remote-connection-through-SAS-ODBC/m-p/269291#M53344</link>
      <description>Admin &amp;amp; abcd1234 is my userid and password for virtual mechine log in. Once I am in virtual machine I hit the Sql ser management studio and i could log in to sql server with windows authentication. but its a problem to log in from sas with the following code:&lt;BR /&gt;&lt;BR /&gt;libname SQLServr &lt;BR /&gt;odbc noprompt = 'DRIVER=SQL Server;&lt;BR /&gt;server=101.102.10.11;&lt;BR /&gt;user=Myserver\admin;&lt;BR /&gt;password=abcd1234'&lt;BR /&gt;database = Mydatabase&lt;BR /&gt;schema = dbo;</description>
      <pubDate>Tue, 10 May 2016 00:21:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-Server-2012-Remote-connection-through-SAS-ODBC/m-p/269291#M53344</guid>
      <dc:creator>mlogan</dc:creator>
      <dc:date>2016-05-10T00:21:39Z</dc:date>
    </item>
  </channel>
</rss>

