April 23, 2016 at 4:32 pm
I have a large Excel database.
I can extract it in ASP.net.
I have over 150 columns with 100000 rows of Data.
I would normally use an INSERT INTO statement but is about impossible with the number of columns.
Is there another SQL command that would transfer the Data to an mdf?
April 24, 2016 at 5:17 am
See if this article helps you:
https://www.simple-talk.com/sql/t-sql-programming/questions-about-using-tsql-to-import-excel-data-you-were-too-shy-to-ask/[/url]
April 24, 2016 at 6:26 am
Import/Export Wizard ?
I use it for basic spreadsheet imports. I have never tried 150 columns, so don't know if there are limits.
April 25, 2016 at 11:26 am
Is this a one-shot import or something that will be recurring? Some people would argue that 150 columns is awfully wide and could benefit from normalization.
-----
[font="Arial"]Knowledge is of two kinds. We know a subject ourselves or we know where we can find information upon it. --Samuel Johnson[/font]
April 26, 2016 at 3:50 am
You can always import it in batches
1 - Insert a new column before "A". Add a UniqueKey to this column. It could be as simple as an incrementing number.
2 - Copy the worksheet twice
3 - On sheet_original, delete all data from column 52 to the end
On sheet_Copy1, delete all data from column 2 to 51, and from 101 to the end
On sheet_Copy2, delete all data from column 2 to 101
4 - Import the 3 worksheets into separate tables
5 - Select all the data from the 3 tables, with a join on the UniqueKey that you created, into your destination table.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply