<?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 Proc SQL  write to MS SQL - target tablename has more than 32 characters in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-write-to-MS-SQL-target-tablename-has-more-than-32/m-p/658548#M197362</link>
    <description>&lt;P&gt;Hey&lt;BR /&gt;I have problem with this variale.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to use a transformation in Data stadio to automate loading til MS SQL with long table names.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get this error.&lt;/P&gt;&lt;DIV class="sasError"&gt;ERROR: CLI execute error: [SAS][ODBC 20101 driver][Microsoft SQL Server]Invalid object name '[Mellemkommunal Odense$OSR Vendor&lt;/DIV&gt;&lt;DIV class="sasError"&gt;No_]'.&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;The problem is single quote, when i am using the variable.&amp;nbsp;&lt;/P&gt;&lt;P&gt;then i write the table name in the cod&lt;/P&gt;&lt;P&gt;execute (&lt;BR /&gt;delete&lt;BR /&gt;from [Mellemkommunal Odense$OSR Vendor No_]&lt;/P&gt;&lt;P&gt;No problems.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestion&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;LIBNAME xpophona BASE "!SAS_DATA/6_eksport/opholdsbetaling_navision/data";


/* Access the data for EXT Opholdsbetaling Navision Write odbc  */ 
LIBNAME x_ophnaw ODBC  DATAsrc=EXT_Opholdsbetaling_Navision_W  SCHEMA=dbo ;
/* code options in the transformation*/
%let SQL_table =%nrqoute([Mellemkommunal Odense$OSR Vendor No_]); /*automatic generated by the transformation*/
%let SQL_columns = %nrquote([VAT Registration No_],[OSR Vendor No_],[OSR Vendor Name],[B-Taxable]);/*automatic generated by the transformation*/

--------------------------------------------------------*/
/*1) Def. of variables                                                                          */
/*---------------------------------------------------------------------------------------------*/
%put &amp;amp;=SQL_table;
%put &amp;amp;=SQL_columns;

proc sql;
	connect to odbc (DATAsrc=EXT_Opholdsbetaling_Navision AUTHDOMAIN="AuthDom MSSQL sasbatch");

	execute (
			delete	   
			from "&amp;amp;SQL_table"
			)
			by odbc;
disconnect to odbc;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 15 Jun 2020 06:28:39 GMT</pubDate>
    <dc:creator>jjmccoydk</dc:creator>
    <dc:date>2020-06-15T06:28:39Z</dc:date>
    <item>
      <title>Proc SQL  write to MS SQL - target tablename has more than 32 characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-write-to-MS-SQL-target-tablename-has-more-than-32/m-p/658548#M197362</link>
      <description>&lt;P&gt;Hey&lt;BR /&gt;I have problem with this variale.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to use a transformation in Data stadio to automate loading til MS SQL with long table names.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get this error.&lt;/P&gt;&lt;DIV class="sasError"&gt;ERROR: CLI execute error: [SAS][ODBC 20101 driver][Microsoft SQL Server]Invalid object name '[Mellemkommunal Odense$OSR Vendor&lt;/DIV&gt;&lt;DIV class="sasError"&gt;No_]'.&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;The problem is single quote, when i am using the variable.&amp;nbsp;&lt;/P&gt;&lt;P&gt;then i write the table name in the cod&lt;/P&gt;&lt;P&gt;execute (&lt;BR /&gt;delete&lt;BR /&gt;from [Mellemkommunal Odense$OSR Vendor No_]&lt;/P&gt;&lt;P&gt;No problems.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestion&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;LIBNAME xpophona BASE "!SAS_DATA/6_eksport/opholdsbetaling_navision/data";


/* Access the data for EXT Opholdsbetaling Navision Write odbc  */ 
LIBNAME x_ophnaw ODBC  DATAsrc=EXT_Opholdsbetaling_Navision_W  SCHEMA=dbo ;
/* code options in the transformation*/
%let SQL_table =%nrqoute([Mellemkommunal Odense$OSR Vendor No_]); /*automatic generated by the transformation*/
%let SQL_columns = %nrquote([VAT Registration No_],[OSR Vendor No_],[OSR Vendor Name],[B-Taxable]);/*automatic generated by the transformation*/

--------------------------------------------------------*/
/*1) Def. of variables                                                                          */
/*---------------------------------------------------------------------------------------------*/
%put &amp;amp;=SQL_table;
%put &amp;amp;=SQL_columns;

proc sql;
	connect to odbc (DATAsrc=EXT_Opholdsbetaling_Navision AUTHDOMAIN="AuthDom MSSQL sasbatch");

	execute (
			delete	   
			from "&amp;amp;SQL_table"
			)
			by odbc;
disconnect to odbc;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jun 2020 06:28:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-write-to-MS-SQL-target-tablename-has-more-than-32/m-p/658548#M197362</guid>
      <dc:creator>jjmccoydk</dc:creator>
      <dc:date>2020-06-15T06:28:39Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL  write to MS SQL - target tablename has more than 32 characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-write-to-MS-SQL-target-tablename-has-more-than-32/m-p/658915#M197393</link>
      <description>1) Try libname 's option  preserve_table_name=yes &lt;BR /&gt;2) Let DB create a view to correct this &amp;gt;32 table name ?</description>
      <pubDate>Mon, 15 Jun 2020 10:52:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-write-to-MS-SQL-target-tablename-has-more-than-32/m-p/658915#M197393</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-06-15T10:52:06Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL  write to MS SQL - target tablename has more than 32 characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-write-to-MS-SQL-target-tablename-has-more-than-32/m-p/660992#M197697</link>
      <description>&lt;P&gt;hey&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1)&amp;nbsp;&lt;/P&gt;&lt;PRE class="xisDoc-codeFragmentLast"&gt;&lt;CODE&gt;preserve_tab_names=yes&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I have the same problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) It is not an option , bacause tablename is defined by Microsoft Business Central.&lt;BR /&gt;&lt;BR /&gt;help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jun 2020 06:56:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-write-to-MS-SQL-target-tablename-has-more-than-32/m-p/660992#M197697</guid>
      <dc:creator>jjmccoydk</dc:creator>
      <dc:date>2020-06-17T06:56:56Z</dc:date>
    </item>
  </channel>
</rss>

