aby
aby

Reputation: 830

Importing data from MS Excel to SQL Server 2008 R2

I've a Microsoft Excel file with 25 columns and I used the data import wizard on SQL Server 2008 R2 studio to import it to already existing table. But, it only maps 14 columns and ignores the rest. Does it have a column number limit or there is a problem with my data?

Upvotes: 0

Views: 17239

Answers (4)

user3666801
user3666801

Reputation: 1

Try to create the Excel columns and table structure in the same format and structure as ms sql table is. Open the excel select the row (whole row by clicking on row number) select the whole data till end of the data (selected first row to last row). press ctrl+c

edit the ms sql table, go to last row where you can find blank.

Select that row by clicking on row button and press ctrl+v.

Done you're excel data will be inserted into sql table.

I tried it in MS SQL 2008

Upvotes: 0

Prahalad Gaggar
Prahalad Gaggar

Reputation: 11599

You can do the other way around.

Step 1. Import sheet in a new table.

Step 2. Use Bulk Query to insert into your prefered table

I think this will solve your Problem.

Upvotes: 0

PGallagher
PGallagher

Reputation: 3113

Can you give some example of your data?

In the mean time... When you're performing your import, I assume you are reaching the Select Source Tables and Views Page;

enter image description here

At this stage, you can edit your column mappings by pressing the Edit Mappings button. This will show the following screen;

enter image description here

Make sure that all your columns are selected there.

Also, on the following screen, it will warn of any mismatches in data;

enter image description here

Are you seeing any warnings here?

Upvotes: 1

Peter L.
Peter L.

Reputation: 7304

I'm not familiar much with SQL Server, but according to this: Excel file Import to Sql server 2008 - column limit for Excel is 255 which is far beyond your numbers. Most likely problem is in your data, but without having the example it's impossible to say what's wrong.

Upvotes: 0

Related Questions