SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Import Data From Excel as varchar


Import Data From Excel as varchar

Author
Message
Scott Thornton-407727
Scott Thornton-407727
SSC-Enthusiastic
SSC-Enthusiastic (175 reputation)SSC-Enthusiastic (175 reputation)SSC-Enthusiastic (175 reputation)SSC-Enthusiastic (175 reputation)SSC-Enthusiastic (175 reputation)SSC-Enthusiastic (175 reputation)SSC-Enthusiastic (175 reputation)SSC-Enthusiastic (175 reputation)

Group: General Forum Members
Points: 175 Visits: 255
Hi,

Am attempting to import a spreadsheet of data as a new table.

I specify the field as varchar(10).

I have made sure that the spreadsheet has the column stored as text.

However the Import Data wizard within SQL workbench or whatever the 2005 replacement is called for Enterprise manager, skips data that doesn't match a numeric value

Eg
My data looks like (coded values)
1A
2
3
0
1A

SSIS inserts nulls instead of the '1A' value.

Why Why Why?

Enterprise Manager and DTS was so easy!!!!!!!!!!!!!!!!!!!!!!!
pduplessis-723389
pduplessis-723389
SSCommitted
SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)

Group: General Forum Members
Points: 1707 Visits: 400
Welcome to one of the most irritating nuances of SSIS. Text is seen as NVarchar and not Varchar. In other words, if you have a text (10), make it Nvarchar (20).
You can use a dataconversion transformation to get past this.

~PD
pduplessis-723389
pduplessis-723389
SSCommitted
SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)

Group: General Forum Members
Points: 1707 Visits: 400
My bad... I meant in Excel, text is seen as nvarchar and not varchar
Scott Thornton-407727
Scott Thornton-407727
SSC-Enthusiastic
SSC-Enthusiastic (175 reputation)SSC-Enthusiastic (175 reputation)SSC-Enthusiastic (175 reputation)SSC-Enthusiastic (175 reputation)SSC-Enthusiastic (175 reputation)SSC-Enthusiastic (175 reputation)SSC-Enthusiastic (175 reputation)SSC-Enthusiastic (175 reputation)

Group: General Forum Members
Points: 175 Visits: 255
Ill try nvarchar next time..

I imported it into MS Access first and then into SQl Server.
pduplessis-723389
pduplessis-723389
SSCommitted
SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)

Group: General Forum Members
Points: 1707 Visits: 400
SSIS and MS Access also has its own unique nuances, some of which are downright irritating.

Good luck!

~PD
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search