Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SSIS and Import/Export (2008)
 NVARCHAR

Author  Topic 

Brittney10
Posting Yak Master

154 Posts

Posted - 2011-01-17 : 15:11:16
I have data in an excel source that contains a lot of different values, so i declared the destination column in SQL as NVARCHAR. However, when I'm importing the data from Excel to SQL using SSIS the values in the Excel file that are only integers (ex. 4) are not importing into the database....everything else is however.

I thought with NVARCHAR it could be letters, numbers, or symbols. What do datatype do i use if I have everything?!

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2011-01-17 : 15:17:58
Your SQL data type is correct, in that it can take all sorts of characters. The problem is in Excel where your column has different data types. Try to convert the whole column in Excel to Text and then re-import. Either that or you'll have to explicitly convert the Excel data to nvarchar.

Jim

Everyday I learn something that somebody else already knew
Go to Top of Page

Brittney10
Posting Yak Master

154 Posts

Posted - 2011-01-17 : 15:46:21
Thanks for the reply!

I tried converting the entire Excel column to Text from General, but that didn't work :( Guess I'll have to try your other suggestion and see if that works
Go to Top of Page
   

- Advertisement -