Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

SSIS: Importing Excel spreadsheet with more than 255 columns Expand / Collapse
Author
Message
Posted Tuesday, April 20, 2010 5:07 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, January 27, 2014 2:40 AM
Points: 103, Visits: 150
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
Post #906713
Posted Monday, January 31, 2011 5:14 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, October 6, 2014 4:05 PM
Points: 3, Visits: 15
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,
Post #1056541
Posted Monday, January 31, 2011 5:19 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 4:51 PM
Points: 5,401, Visits: 7,513
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
Post #1056542
Posted Monday, January 31, 2011 5:33 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, October 6, 2014 4:05 PM
Points: 3, Visits: 15
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.
Post #1056545
Posted Monday, January 31, 2011 5:34 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, October 6, 2014 4:05 PM
Points: 3, Visits: 15
Sorry, "direction" should be "directly".
Post #1056546
Posted Monday, January 31, 2011 5:42 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 4:51 PM
Points: 5,401, Visits: 7,513
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
Post #1056548
Posted Tuesday, February 1, 2011 3:01 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, January 27, 2014 2:40 AM
Points: 103, Visits: 150

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
Post #1056673
Posted Tuesday, February 1, 2011 8:26 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Friday, October 10, 2014 4:13 AM
Points: 205, Visits: 1,339
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


Post #1056854
Posted Tuesday, February 1, 2011 8:29 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, January 27, 2014 2:40 AM
Points: 103, Visits: 150

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. :)

Thanks,

Graham
Post #1056855
Posted Monday, January 20, 2014 4:35 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, March 24, 2014 5:39 PM
Points: 3, Visits: 59
you could use two data sources to load the data then join them together as explained in this Post
Post #1532819
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse