<?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: questions about SAS  ODBC connection to SQL server data in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/questions-about-SAS-ODBC-connection-to-SQL-server-data/m-p/327894#M9575</link>
    <description>&lt;P&gt;Unfortunately I don't think so. Your DATASRC definition could include just the server name, but then you will have to add the DATABASE= and SCHEMA= options to your LIBNAME statement for the tables to be visible. Check out these examples:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/kb/52/777.html" target="_blank"&gt;http://support.sas.com/kb/52/777.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also be aware if you have any table names longer than 32 characters, they wont show in SAS - this is a current SAS limitation. You have to use PASSTHRU to read those.&lt;/P&gt;</description>
    <pubDate>Thu, 26 Jan 2017 23:13:29 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2017-01-26T23:13:29Z</dc:date>
    <item>
      <title>questions about SAS  ODBC connection to SQL server data</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/questions-about-SAS-ODBC-connection-to-SQL-server-data/m-p/327557#M9555</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I have some questions about SAS ODBC connection to SQL data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1) When set up the ODBC.ini file, do you have to set up separate entry for every database you want to access?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Or can you do it at server level, so you can access all the databases under that server?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I think we only can&amp;nbsp;set up&amp;nbsp;ODBC.ini file at database level, correct me if I am wrong.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2) When you try to access the SQL data via libname in SAS, can you see all the tables under the libref in SAS libraries?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for example,&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;LIBNAME&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; test &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;odbc&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;Password&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=*** &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;User&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=*** &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;DATASRC&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=*** &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;schema&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=sas1;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Should I see all the tables&amp;nbsp;of &lt;FONT face="Courier New"&gt;schema&lt;/FONT&gt; sas1&amp;nbsp;in library "test" in SAS?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Thank you!&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Jade&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2017 22:00:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/questions-about-SAS-ODBC-connection-to-SQL-server-data/m-p/327557#M9555</guid>
      <dc:creator>Jade_SAS</dc:creator>
      <dc:date>2017-01-25T22:00:00Z</dc:date>
    </item>
    <item>
      <title>Re: questions about SAS  ODBC connection to SQL server data</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/questions-about-SAS-ODBC-connection-to-SQL-server-data/m-p/327579#M9561</link>
      <description>&lt;P&gt;You can set up an ODBC connection at the server level and then use SQL passthru to identify which database, schema and table you want. It would look something like this:&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;uid=myusr1;pwd=mypwd1;");
  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>Wed, 25 Jan 2017 23:02:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/questions-about-SAS-ODBC-connection-to-SQL-server-data/m-p/327579#M9561</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2017-01-25T23:02:29Z</dc:date>
    </item>
    <item>
      <title>Re: questions about SAS  ODBC connection to SQL server data</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/questions-about-SAS-ODBC-connection-to-SQL-server-data/m-p/327707#M9568</link>
      <description>&lt;P&gt;Thank you SASKiwi!&lt;/P&gt;&lt;P&gt;If I set up the libname at server level,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;LIBNAME&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; test &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;odbc&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;Password&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=*** &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;User&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=*** &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;DATASRC&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=***&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Will I be able to see all the datasets under "test" library? Thanks!&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2017 13:22:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/questions-about-SAS-ODBC-connection-to-SQL-server-data/m-p/327707#M9568</guid>
      <dc:creator>Jade_SAS</dc:creator>
      <dc:date>2017-01-26T13:22:38Z</dc:date>
    </item>
    <item>
      <title>Re: questions about SAS  ODBC connection to SQL server data</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/questions-about-SAS-ODBC-connection-to-SQL-server-data/m-p/327894#M9575</link>
      <description>&lt;P&gt;Unfortunately I don't think so. Your DATASRC definition could include just the server name, but then you will have to add the DATABASE= and SCHEMA= options to your LIBNAME statement for the tables to be visible. Check out these examples:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/kb/52/777.html" target="_blank"&gt;http://support.sas.com/kb/52/777.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also be aware if you have any table names longer than 32 characters, they wont show in SAS - this is a current SAS limitation. You have to use PASSTHRU to read those.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2017 23:13:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/questions-about-SAS-ODBC-connection-to-SQL-server-data/m-p/327894#M9575</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2017-01-26T23:13:29Z</dc:date>
    </item>
    <item>
      <title>Re: questions about SAS  ODBC connection to SQL server data</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/questions-about-SAS-ODBC-connection-to-SQL-server-data/m-p/328139#M9593</link>
      <description>&lt;P&gt;Thank you for the help!&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2017 21:06:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/questions-about-SAS-ODBC-connection-to-SQL-server-data/m-p/328139#M9593</guid>
      <dc:creator>Jade_SAS</dc:creator>
      <dc:date>2017-01-27T21:06:50Z</dc:date>
    </item>
  </channel>
</rss>

