BookmarkSubscribeRSS Feed
jjmccoydk
Calcite | Level 5

Hey
I have problem with this variale.

 

I want to use a transformation in Data stadio to automate loading til MS SQL with long table names.

 

I get this error.

ERROR: CLI execute error: [SAS][ODBC 20101 driver][Microsoft SQL Server]Invalid object name '[Mellemkommunal Odense$OSR Vendor
No_]'.
 

The problem is single quote, when i am using the variable. 

then i write the table name in the cod

execute (
delete
from [Mellemkommunal Odense$OSR Vendor No_]

No problems.

 

Any suggestion

 

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 &=SQL_table;
%put &=SQL_columns;

proc sql;
	connect to odbc (DATAsrc=EXT_Opholdsbetaling_Navision AUTHDOMAIN="AuthDom MSSQL sasbatch");

	execute (
			delete	   
			from "&SQL_table"
			)
			by odbc;
disconnect to odbc;
quit;

 

2 REPLIES 2
Ksharp
Super User
1) Try libname 's option preserve_table_name=yes
2) Let DB create a view to correct this >32 table name ?
jjmccoydk
Calcite | Level 5

hey

 

1) 

preserve_tab_names=yes

I have the same problem.

 

2) It is not an option , bacause tablename is defined by Microsoft Business Central.

help

 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 315 views
  • 0 likes
  • 2 in conversation