Desktop productivity for business analysts and programmers

Importing a table with long column names from SQL Server to Enterprise Guide

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 12
Accepted Solution

Importing a table with long column names from SQL Server to Enterprise Guide

Has anyone faced problems while loading an SQL table with long column names? When i try to drag a table having long column names onto a process flow from a library , I get the error that an Open data operation and the error is that the variable < long column name> is not foind in the file.

It appears to me that the SAS/Access engine for SQL server is not able to recognize long column names. If anyone has experienced this, would love to know what workarounds are avaialbe for this issue.

 

Thanks,

Sethu


Accepted Solutions
Solution
‎04-28-2016 04:02 PM
Super User
Posts: 3,233

Re: Importing a table with long column names from SQL Server to Enterprise Guide

Try this SAS option: options validvarname = V7;

 

This should truncate on-the-fly any long SQL Server column names to no more than 32 characters.

View solution in original post


All Replies
Super User
Posts: 19,038

Re: Importing a table with long column names from SQL Server to Enterprise Guide

One workaround is to create a view that has the variable renamed to something that's shorter.

Then load the view.

Occasional Contributor
Posts: 12

Re: Importing a table with long column names from SQL Server to Enterprise Guide

Thanks for the reply.

I also posed this question to SAS technical support and they came back with the following solution:

"

For the long column names, in EG go to Tools>Options>SAS Programs.  

Put a check mark beside "Submit SAS code when server is connected" and click the Edit box.  Enter:

 

  options validvarname=v7;"

 

This has the effect of truncating the long variable names but it allows me to proceed with defining tasks on EG

Super User
Posts: 3,233

Re: Importing a table with long column names from SQL Server to Enterprise Guide

Cool - problem solved. Please be aware the 32 character limit also applies to table names. If you have table names > 32 characters they will not show in your data libraries / server list at all and you will need to use SQL passthru to read them.

Solution
‎04-28-2016 04:02 PM
Super User
Posts: 3,233

Re: Importing a table with long column names from SQL Server to Enterprise Guide

Try this SAS option: options validvarname = V7;

 

This should truncate on-the-fly any long SQL Server column names to no more than 32 characters.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 462 views
  • 6 likes
  • 3 in conversation