<?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 Connect via ODBC in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Connect-via-ODBC/m-p/447809#M13804</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm connecting to a SQL database via ODBC and run the following code to do so;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*Link via ODBC to the MS Connect Server*/&lt;/P&gt;&lt;P&gt;libname Connect&lt;BR /&gt;odbc complete="driver=SQL Server;&lt;BR /&gt;database=connect_productionreports ;&lt;BR /&gt;server=fcl-sql-v075"&lt;BR /&gt;schema=dbo;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This piece of code allows me to view all tables in this area. It's come to my attention that some tables have been stored with a name of more 32 characters that I can't see. There is a table called "Contact_Company_ExtSL_ClientGroupGlobalRP " that has 3 columns that I can't see in the database, for example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please could you tell me how I could amend the code above to pull in all tables regardless of the table length name?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks&lt;BR /&gt;&lt;BR /&gt;Chris&lt;/P&gt;</description>
    <pubDate>Thu, 22 Mar 2018 15:02:35 GMT</pubDate>
    <dc:creator>cmoore</dc:creator>
    <dc:date>2018-03-22T15:02:35Z</dc:date>
    <item>
      <title>Connect via ODBC</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Connect-via-ODBC/m-p/447809#M13804</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm connecting to a SQL database via ODBC and run the following code to do so;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*Link via ODBC to the MS Connect Server*/&lt;/P&gt;&lt;P&gt;libname Connect&lt;BR /&gt;odbc complete="driver=SQL Server;&lt;BR /&gt;database=connect_productionreports ;&lt;BR /&gt;server=fcl-sql-v075"&lt;BR /&gt;schema=dbo;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This piece of code allows me to view all tables in this area. It's come to my attention that some tables have been stored with a name of more 32 characters that I can't see. There is a table called "Contact_Company_ExtSL_ClientGroupGlobalRP " that has 3 columns that I can't see in the database, for example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please could you tell me how I could amend the code above to pull in all tables regardless of the table length name?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks&lt;BR /&gt;&lt;BR /&gt;Chris&lt;/P&gt;</description>
      <pubDate>Thu, 22 Mar 2018 15:02:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Connect-via-ODBC/m-p/447809#M13804</guid>
      <dc:creator>cmoore</dc:creator>
      <dc:date>2018-03-22T15:02:35Z</dc:date>
    </item>
    <item>
      <title>Re: Connect via ODBC</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Connect-via-ODBC/m-p/447815#M13805</link>
      <description>&lt;P&gt;If table names are longer than 32 char, then they are truncated to 32 Char. If truncated name already exists then SAS generates unique name by replacing the last char with a number.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Mar 2018 15:11:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Connect-via-ODBC/m-p/447815#M13805</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2018-03-22T15:11:26Z</dc:date>
    </item>
    <item>
      <title>Re: Connect via ODBC</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Connect-via-ODBC/m-p/447819#M13806</link>
      <description>It used to be that the tables with names longer than 32 chars are not shown. Variables are truncated.  The workarounds are: &lt;BR /&gt;1) SQL Pass through instead&lt;BR /&gt;2) Creating a view on the SQL Server side with a table name that is less than 32 chars. This is usually the easiest solution.</description>
      <pubDate>Thu, 22 Mar 2018 15:16:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Connect-via-ODBC/m-p/447819#M13806</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-03-22T15:16:28Z</dc:date>
    </item>
    <item>
      <title>Re: Connect via ODBC</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Connect-via-ODBC/m-p/448154#M13818</link>
      <description>&lt;P&gt;Thanks for your input. I have attempted to write a Pass-through query but it doesn't seem to connect. When I run the following it connects fine and I can see all the tables;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;libname Connect&lt;BR /&gt;odbc complete="driver=SQL Server;&lt;BR /&gt;database=connect_productionreports ;&lt;BR /&gt;server=fcl-sql-v075"&lt;BR /&gt;schema=dbo;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I just want to target the table with more than 32 characters I have tried the following;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;connect to odbc (noprompt ="dsn=fcl-sql-v075;DRIVER=SQLServer;uid=c***e;pwd=Lo****;");&lt;/P&gt;&lt;P&gt;create table Prod02test as&lt;BR /&gt;select * from connection to odbc&lt;BR /&gt;(SELECT *&lt;BR /&gt;FROM connect_productionreports.dbo.Contact_Company_ExtSL_FormalCRMProgrammesandTargetingLists&lt;BR /&gt;)&lt;BR /&gt;;&lt;BR /&gt;disconnect from odbc;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This doesn't connect. Is there something stupid that I am doing as I've never needed to use these queries before.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;many thanks&lt;BR /&gt;&lt;BR /&gt;Chris&lt;/P&gt;</description>
      <pubDate>Fri, 23 Mar 2018 13:43:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Connect-via-ODBC/m-p/448154#M13818</guid>
      <dc:creator>cmoore</dc:creator>
      <dc:date>2018-03-23T13:43:37Z</dc:date>
    </item>
    <item>
      <title>Re: Connect via ODBC</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Connect-via-ODBC/m-p/448367#M13824</link>
      <description>&lt;P&gt;Try using SERVER= and correct driver name. Please note connection strings need to be exact, including blanks.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;connect to odbc (noprompt ="server=fcl-sql-v075;DRIVER=SQL Server;uid=c***e;pwd=Lo****;");&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Mar 2018 23:00:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Connect-via-ODBC/m-p/448367#M13824</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2018-03-23T23:00:47Z</dc:date>
    </item>
    <item>
      <title>Re: Connect via ODBC</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Connect-via-ODBC/m-p/449154#M13854</link>
      <description>&lt;P&gt;I always use&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;connect using&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;these days. So much easier...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;libname&amp;nbsp;SQLSLIB odbc&amp;nbsp;database= server= schema=&amp;nbsp; etc;&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;proc sql;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;connect using&amp;nbsp;&lt;SPAN&gt;SQLSLIB&amp;nbsp;;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;create table XX as select * from connection to &lt;SPAN&gt;SQLSLIB&amp;nbsp; (&amp;nbsp; etc&amp;nbsp; );&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Mar 2018 21:05:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Connect-via-ODBC/m-p/449154#M13854</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-03-27T21:05:30Z</dc:date>
    </item>
  </channel>
</rss>

