Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trouble Importing data from Excel

Status
Not open for further replies.

BaoBao

Programmer
Oct 28, 2002
3
US
I tried to import data from a Excel file to the database, however, the data in one of the column cannot be imported correctly.

That field is declared as type nvarchar in the database, however 98% of the data in that column are integers, therefore, it only imported those integer data into the database, but the data contains text are ignored and imported as NULL value.

I tried explicitly changed that column to be "text" in the excel file, but it still won't help.

Please help!
 
oh ok try to get it in to Access and then try to do DTS it will be faster.
 
You're close...

Excel is a horrible data source, so you have to trick it into providing the right data type by inserting a false row (which you later filter out in CR) in the beginning of the spreadsheet that complies to the data type you want, otherwise it makes silly assumptions.

So if you need the column to have text and numbers, insert the word "NUKEME" into the first row and it will always handle text and numbers for that column.

If you can, just use the data directly from your database as opposed to Excel.

-k kai@informeddatadecisions.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top