• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Renaming Column names in Excel with Coldfusion

New Here ,
Dec 14, 2006 Dec 14, 2006

Copy link to clipboard

Copied

a client has an excel sheet that gets sent to them
I already have it working where they can upload the excel file and it will import to their SQLServer

however the files comes with a dozen or so 'database unfriendly' column names, mostly space
ex: First Name

Is there a way with Coldfusion to read the Excel file and rename the Column names?
that way I could just import that file and they don't have to rename the column names manually.

thanks in advance,
Alex
TOPICS
Advanced techniques

Views

600

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 14, 2006 Dec 14, 2006

Copy link to clipboard

Copied

LATEST
1. SQLServer will let you use the names w/ spaces if you enclose them in double quotes, e.g. "First Name".

2. How are you getting the data from the Excel file into SQLServer? If you are using, for example, a CREATE TABLE query you can use the Replace() function to replace spaces in the column name w/ underscores or eliminate them altogether.

3. How are you reading the Excel file? You might want to consider using cfx_ExcelQuery which would just name the columns according to the Excel column, such as A, B, etc.

Ken

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation