SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SSIS: Importing Excel spreadsheet with more than 255 columns


SSIS: Importing Excel spreadsheet with more than 255 columns

Author
Message
GRussell31
GRussell31
Ten Centuries
Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)

Group: General Forum Members
Points: 1338 Visits: 156
Hi,

I'm trying to import an Excel spreadsheet into SQL Server 2008 that has more than 255 columns.
The excel spreadsheet is in Office 2007 format and contains macro's causing it to be a .xlsm file.

As SSIS cannot import directly from a .xlsm file I've installed the Access Data Engine drivers (ACE) to connect to the database.

This seems to connect correctly but seems to only copy the first 255 columns from the spreadsheet and it contains lots more columns.

I've tried saving the database as an .xlsx file and used the Excel driver (not ACE) and this also seemed to limit it to 255 characters.

In desperation I've tried linking an Access database but this also hit the 255 column limit.

Can anyone offer me a suggestion as to how I can move forward?

Many thanks.

Graham
Adam Blumenfeld
Adam Blumenfeld
SSC-Enthusiastic
SSC-Enthusiastic (111 reputation)SSC-Enthusiastic (111 reputation)SSC-Enthusiastic (111 reputation)SSC-Enthusiastic (111 reputation)SSC-Enthusiastic (111 reputation)SSC-Enthusiastic (111 reputation)SSC-Enthusiastic (111 reputation)SSC-Enthusiastic (111 reputation)

Group: General Forum Members
Points: 111 Visits: 33
I have exactly the same issue. Did you get any responses? Or, did you figure it out on your own, and are you willing to share?

Thanks,
Evil Kraig F
Evil Kraig F
SSC Guru
SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)

Group: General Forum Members
Points: 52633 Visits: 7660
Adam,

The 255 column limitation is due to MS Access. You should be able to directly connect SSIS to Excel and pull in all the Excel columns in a direct feed.


- Craig Farrell

Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

For better assistance in answering your questions | Forum Netiquette
For index/tuning help, follow these directions. |Tally Tables

Twitter: @AnyWayDBA
Adam Blumenfeld
Adam Blumenfeld
SSC-Enthusiastic
SSC-Enthusiastic (111 reputation)SSC-Enthusiastic (111 reputation)SSC-Enthusiastic (111 reputation)SSC-Enthusiastic (111 reputation)SSC-Enthusiastic (111 reputation)SSC-Enthusiastic (111 reputation)SSC-Enthusiastic (111 reputation)SSC-Enthusiastic (111 reputation)

Group: General Forum Members
Points: 111 Visits: 33
Craig,

I'm just using Microsoft SQL Server Management Studio to import from an .xlsx file direction. If I have the import wizard create the table, it only creates the first 255 columns, and imports them. If I first create a table in SQL Server, with the 700 columns that I need, and then try to import, it again only imports the first 255 columns, and leaves the others as NULL.
Adam Blumenfeld
Adam Blumenfeld
SSC-Enthusiastic
SSC-Enthusiastic (111 reputation)SSC-Enthusiastic (111 reputation)SSC-Enthusiastic (111 reputation)SSC-Enthusiastic (111 reputation)SSC-Enthusiastic (111 reputation)SSC-Enthusiastic (111 reputation)SSC-Enthusiastic (111 reputation)SSC-Enthusiastic (111 reputation)

Group: General Forum Members
Points: 111 Visits: 33
Sorry, "direction" should be "directly".
Evil Kraig F
Evil Kraig F
SSC Guru
SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)

Group: General Forum Members
Points: 52633 Visits: 7660
Adam Blumenfeld (1/31/2011)
Craig,

I'm just using Microsoft SQL Server Management Studio to import from an .xlsx file direction. If I have the import wizard create the table, it only creates the first 255 columns, and imports them. If I first create a table in SQL Server, with the 700 columns that I need, and then try to import, it again only imports the first 255 columns, and leaves the others as NULL.


I'll have to muck with it to confirm, but my quick research when I saw this pop up indicated otherwise. However, I can't speak to what the wizard will do. Have you tried creating your own package in BIDS/VS2k8 and creating a source that hooks to Excel 12.0, and then the import?

I'm currently dealing with the drivers for that now at this location for the newer versions (I use 2k5 and office 2k7 isn't immediately available, without this installed: http://www.microsoft.com/downloads/en/details.aspx?FamilyID=7554F536-8C28-4598-9B72-EF94E038C891&displaylang=en), so once I get that cleaned up in a few days I can perform some local testing.


- Craig Farrell

Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

For better assistance in answering your questions | Forum Netiquette
For index/tuning help, follow these directions. |Tally Tables

Twitter: @AnyWayDBA
GRussell31
GRussell31
Ten Centuries
Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)

Group: General Forum Members
Points: 1338 Visits: 156
Hi,

Sadly I didn't find a way around the problem.

I was able to create a macro to reformat the spreadsheet so that all of the data I needed was within the first 255 columns and was able to import the data that way.

The extra problems I had was that the spreadsheet had macro's already in it, so the default driver wouldn't work and I had to use the ACE drivers (and even the beta drivers at the time wouldn't work!).

Graham
Gosta Munktell
Gosta Munktell
Hall of Fame
Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)

Group: General Forum Members
Points: 3576 Visits: 2175
Grahamn

"and contains macro's causing it to be a .xlsm file."

As you already use a macro why not save the file as a TAB separeted text file etc.txt
and use SSIS or T-SQL bulk insert to import the file.:-)
I never use SSIS to import natural Excel files.


Gosta M
GRussell31
GRussell31
Ten Centuries
Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)

Group: General Forum Members
Points: 1338 Visits: 156
Hi,

I was able to amend the format of the spreadsheet before I imported it.

As we have a automated process of importing the file, I'd be interested to see if you could execute a macro via SSIS to export it first. Smile

Thanks,

Graham
waheed-429856
waheed-429856
SSC Journeyman
SSC Journeyman (85 reputation)SSC Journeyman (85 reputation)SSC Journeyman (85 reputation)SSC Journeyman (85 reputation)SSC Journeyman (85 reputation)SSC Journeyman (85 reputation)SSC Journeyman (85 reputation)SSC Journeyman (85 reputation)

Group: General Forum Members
Points: 85 Visits: 59
you could use two data sources to load the data then join them together as explained in this Post
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search