<?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: Accessing a Microsoft SQL Server Database from SAS using SQL Server Authentication in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Accessing-a-Microsoft-SQL-Server-Database-from-SAS-using-SQL/m-p/307770#M65963</link>
    <description>&lt;P&gt;Is your user account stored separately in SQL Server or are you authenticating with your OS account - usually called Windows Authentication if your SAS server runs on Windows? If it is the latter then something like this should work:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
 connect to odbc (noprompt = "server=MyServerName;DRIVER=SQL Server;Trusted Connection=yes;");
  create table Want  as 
  select * from connection to odbc
  (SELECT *
   FROM [MyDatabase].[MySchema1].[MyTable]
   )
  ;
  disconnect from odbc;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 27 Oct 2016 21:44:43 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2016-10-27T21:44:43Z</dc:date>
    <item>
      <title>Accessing a Microsoft SQL Server Database from SAS using SQL Server Authentication</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Accessing-a-Microsoft-SQL-Server-Database-from-SAS-using-SQL/m-p/307758#M65958</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to access a Microsoft SQL Server Database from SAS using SQL Server Authentication. I have tried this syntax below with no luck. I was wondering if there is a different sytanx to use?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P align="left"&gt;/* SQL Server Authentication reference: " &lt;A href="https://support.sas.com/techsup/technote/ts765.pdf" target="_blank"&gt;https://support.sas.com/techsup/technote/ts765.pdf&lt;/A&gt;" */&lt;/P&gt;&lt;P&gt;LIBNAME SQL ODBC noprompt= "dsn=sqlsrv; uid=; pwd=; wsid=d17117";&lt;/P&gt;&lt;P align="left"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;JP&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2016 20:45:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Accessing-a-Microsoft-SQL-Server-Database-from-SAS-using-SQL/m-p/307758#M65958</guid>
      <dc:creator>JNPLNCE</dc:creator>
      <dc:date>2016-10-27T20:45:23Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing a Microsoft SQL Server Database from SAS using SQL Server Authentication</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Accessing-a-Microsoft-SQL-Server-Database-from-SAS-using-SQL/m-p/307770#M65963</link>
      <description>&lt;P&gt;Is your user account stored separately in SQL Server or are you authenticating with your OS account - usually called Windows Authentication if your SAS server runs on Windows? If it is the latter then something like this should work:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
 connect to odbc (noprompt = "server=MyServerName;DRIVER=SQL Server;Trusted Connection=yes;");
  create table Want  as 
  select * from connection to odbc
  (SELECT *
   FROM [MyDatabase].[MySchema1].[MyTable]
   )
  ;
  disconnect from odbc;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Oct 2016 21:44:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Accessing-a-Microsoft-SQL-Server-Database-from-SAS-using-SQL/m-p/307770#M65963</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2016-10-27T21:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing a Microsoft SQL Server Database from SAS using SQL Server Authentication</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Accessing-a-Microsoft-SQL-Server-Database-from-SAS-using-SQL/m-p/307772#M65964</link>
      <description>&lt;P&gt;My user account is stored separately in SQL Server. I've attached a screenshot of the sql log in. Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13083iE89D111B2DEE2A24/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="SQL_Server_Authentication.PNG" title="SQL_Server_Authentication.PNG" /&gt;</description>
      <pubDate>Thu, 27 Oct 2016 21:53:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Accessing-a-Microsoft-SQL-Server-Database-from-SAS-using-SQL/m-p/307772#M65964</guid>
      <dc:creator>JNPLNCE</dc:creator>
      <dc:date>2016-10-27T21:53:24Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing a Microsoft SQL Server Database from SAS using SQL Server Authentication</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Accessing-a-Microsoft-SQL-Server-Database-from-SAS-using-SQL/m-p/307776#M65966</link>
      <description>&lt;P&gt;Set it up in your DSN set up (Control Panel/ODBC Connections) rather than SAS and then use a 'plain' connection string.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I find this method easier to manage and then my password and uid are not stored in code anywhere.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;LIBNAME SQL ODBC DSN=’myserver’ schema=dbo; &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Oct 2016 22:01:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Accessing-a-Microsoft-SQL-Server-Database-from-SAS-using-SQL/m-p/307776#M65966</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-10-27T22:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing a Microsoft SQL Server Database from SAS using SQL Server Authentication</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Accessing-a-Microsoft-SQL-Server-Database-from-SAS-using-SQL/m-p/307787#M65971</link>
      <description>&lt;P&gt;If you still prefer to define everything in code and avoid the ODBC Adminstrator then this should work:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname sqlsrvr odbc noprompt = "server=MyServerName;DRIVER=SQL Server;uid=myusr1;pwd=mypwd1;";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2016 23:22:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Accessing-a-Microsoft-SQL-Server-Database-from-SAS-using-SQL/m-p/307787#M65971</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2016-10-27T23:22:32Z</dc:date>
    </item>
  </channel>
</rss>

