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.
Author |
Topic |
shifis
Posting Yak Master
157 Posts |
Posted - 2008-12-03 : 21:21:16
|
HiI have a excel file that have a cell with information like these:003230070When I used the export of sql server 2005 to export this sheet to a sql table these information pass has:323070What can I do to not lose the ceros |
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2008-12-03 : 21:47:26
|
What datatype you used in SQL table? |
 |
|
shifis
Posting Yak Master
157 Posts |
Posted - 2008-12-03 : 22:21:40
|
I used char(3) |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-12-04 : 08:23:00
|
it seems like the table columns data type is integer. if you want precedding 0's also make it as varchar |
 |
|
LOOKUP_BI
Constraint Violating Yak Guru
295 Posts |
Posted - 2008-12-04 : 17:01:21
|
Im not sure how far this is correct,but I created and excel sheet with the same data and mapped it to an ole db source.I tried setting the column to varchar for sql table .While executing I received an err msg "Cannot convert between unicode and non unicode".Therefore I changed the data type to nvarchar.It worked then ! |
 |
|
QAZAFI
Yak Posting Veteran
50 Posts |
Posted - 2008-12-11 : 17:08:31
|
Just please try to use Nvarchar data type instead of varchar or char and It will get fixedMany thanksSyed |
 |
|
QAZAFI
Yak Posting Veteran
50 Posts |
Posted - 2008-12-11 : 17:12:04
|
it is because the data type of excel sheet in uniciode and u could not convert data between non unicode and unicode but u can change data type of excel column on going to advance editor as wellthanks |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-12-12 : 02:09:07
|
Format the cell to be Text before exporting data to itMadhivananFailing to plan is Planning to fail |
 |
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2008-12-12 : 20:20:33
|
You can add Data Conversion Task in Between task to resolve it. |
 |
|
|
|
|