<?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 Create SQL table using SAS ODBC? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Create-SQL-table-using-SAS-ODBC/m-p/140477#M37548</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="background-color: rgba(255, 255, 255, 0);"&gt;I refer to ODBC libraries using the following statement&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: rgba(255, 255, 255, 0);"&gt;LIBNAME STATIC ODBC DATASRC = static SCHEMA = DBO USER = &amp;lt;username&amp;gt; PASSWORD = &amp;lt;password&amp;gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: rgba(255, 255, 255, 0);"&gt;I am trying to create a new table within the the Static table in SQL Server using the following code:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: rgba(255, 255, 255, 0);"&gt;proc sql;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: rgba(255, 255, 255, 0);"&gt;create table static.NEW_SQL_TABLE as&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: rgba(255, 255, 255, 0);"&gt;select * from static.OLD_SQL_TABLE (obs = 10);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: rgba(255, 255, 255, 0);"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: rgba(255, 255, 255, 0);"&gt;I get the following error --&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: rgba(255, 255, 255, 0);"&gt;ERROR: CLI Execute Error: [Microsoft][ODBC SQL Server Driver][SQL Server] Invalid object name 'DBO.NEW_SQL_TABLE'.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: rgba(255, 255, 255, 0);"&gt;:[Microsoft][ODBC SQL Server Driver][SQL Server] Statement(s) could not be prepared.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: rgba(255, 255, 255, 0);"&gt;However a simple temporary dataset within SAS works perfectly fine using the below code:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: rgba(255, 255, 255, 0);"&gt;proc sql;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: rgba(255, 255, 255, 0);"&gt;create table TEMP_SQL_TABLE as&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: rgba(255, 255, 255, 0);"&gt;select * from static.OLD_SQL_TABLE (obs = 10);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: rgba(255, 255, 255, 0);"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: rgba(255, 255, 255, 0);"&gt;Can anybody please help me with this? How else will I be able to directly write a SAS dataset into the SQL database (without having to export to csv and then importing back again, which is what I currently do -pardon my ignorance here)?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: rgba(255, 255, 255, 0);"&gt;Thanks a ton.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Mar 2014 04:29:43 GMT</pubDate>
    <dc:creator>Arun_23</dc:creator>
    <dc:date>2014-03-12T04:29:43Z</dc:date>
    <item>
      <title>Create SQL table using SAS ODBC?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Create-SQL-table-using-SAS-ODBC/m-p/140477#M37548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="background-color: rgba(255, 255, 255, 0);"&gt;I refer to ODBC libraries using the following statement&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: rgba(255, 255, 255, 0);"&gt;LIBNAME STATIC ODBC DATASRC = static SCHEMA = DBO USER = &amp;lt;username&amp;gt; PASSWORD = &amp;lt;password&amp;gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: rgba(255, 255, 255, 0);"&gt;I am trying to create a new table within the the Static table in SQL Server using the following code:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: rgba(255, 255, 255, 0);"&gt;proc sql;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: rgba(255, 255, 255, 0);"&gt;create table static.NEW_SQL_TABLE as&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: rgba(255, 255, 255, 0);"&gt;select * from static.OLD_SQL_TABLE (obs = 10);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: rgba(255, 255, 255, 0);"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: rgba(255, 255, 255, 0);"&gt;I get the following error --&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: rgba(255, 255, 255, 0);"&gt;ERROR: CLI Execute Error: [Microsoft][ODBC SQL Server Driver][SQL Server] Invalid object name 'DBO.NEW_SQL_TABLE'.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: rgba(255, 255, 255, 0);"&gt;:[Microsoft][ODBC SQL Server Driver][SQL Server] Statement(s) could not be prepared.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: rgba(255, 255, 255, 0);"&gt;However a simple temporary dataset within SAS works perfectly fine using the below code:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: rgba(255, 255, 255, 0);"&gt;proc sql;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: rgba(255, 255, 255, 0);"&gt;create table TEMP_SQL_TABLE as&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: rgba(255, 255, 255, 0);"&gt;select * from static.OLD_SQL_TABLE (obs = 10);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: rgba(255, 255, 255, 0);"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: rgba(255, 255, 255, 0);"&gt;Can anybody please help me with this? How else will I be able to directly write a SAS dataset into the SQL database (without having to export to csv and then importing back again, which is what I currently do -pardon my ignorance here)?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: rgba(255, 255, 255, 0);"&gt;Thanks a ton.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Mar 2014 04:29:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Create-SQL-table-using-SAS-ODBC/m-p/140477#M37548</guid>
      <dc:creator>Arun_23</dc:creator>
      <dc:date>2014-03-12T04:29:43Z</dc:date>
    </item>
    <item>
      <title>Re: Create SQL table using SAS ODBC?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Create-SQL-table-using-SAS-ODBC/m-p/140478#M37549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not particularly familiar with SQL Server so hope this is not too wide of the mark.&amp;nbsp; In Oracle the schema is a two level dimension, XXXYYY$VVVEEE, so with a $ division.&amp;nbsp; I am wondering if something along those lines is your issue in the DBO is one level.&amp;nbsp; There does seem to be something about multi level schemas after 2005 version:&lt;/P&gt;&lt;P&gt;&lt;A class="active_link" href="http://technet.microsoft.com/en-us/library/ms190387(v=SQL.105).aspx" title="http://technet.microsoft.com/en-us/library/ms190387(v=SQL.105).aspx"&gt;User-Schema Separation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only other thing I remember from access Oracle is that we had to do something like:&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; connect to oracle (path=dddd user=aaa orapw=cccc);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; execute (drop table A_TABLE) by oracle;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; execute (commit) by oracle;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; disconnect from oracle;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;Now of course the above is for OC however, the execute (sql commands) by db connection may be of help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Mar 2014 09:43:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Create-SQL-table-using-SAS-ODBC/m-p/140478#M37549</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-03-12T09:43:57Z</dc:date>
    </item>
    <item>
      <title>Re: Create SQL table using SAS ODBC?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Create-SQL-table-using-SAS-ODBC/m-p/140479#M37550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here are somethings I would look at:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--Have you verified that you have write permissions in the database?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--Have you tried passthru sql to the SQL server? (which is what &lt;A __default_attr="814511" __jive_macro_name="user" class="jive_macro jive_macro_user" href="https://communities.sas.com/" modifiedtitle="true" title="RW9"&gt;&lt;/A&gt; did in his example to an oracle database... just look up the syntax for SQL Server)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I dont think you mentioned which version of sas or SQL server you are using. This could help solve the issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could always open a ticket with SAS support to see if they could help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Mar 2014 11:35:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Create-SQL-table-using-SAS-ODBC/m-p/140479#M37550</guid>
      <dc:creator>esjackso</dc:creator>
      <dc:date>2014-03-12T11:35:09Z</dc:date>
    </item>
  </channel>
</rss>

