SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Importing CSV file - include/ignore white space
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

barnsley
Starting Member

31 Posts

Posted - 11/02/2012 :  11:52:08  Show Profile  Reply with Quote
I am importing CSV files into a sql database table via a DTS package.

In my excel file it contains data with a space in the middle of the string.
e.g.
"123a bc"

As a result my data imported stops at the first white space and looks lie this:
"123a"

How can I get it to either ignore the white space or simply include it as part of the import?


mark.

visakh16
Very Important crosS Applying yaK Herder

India
52309 Posts

Posted - 11/03/2012 :  22:44:03  Show Profile  Reply with Quote
what have you defined as column delimiter?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

barnsley
Starting Member

31 Posts

Posted - 11/05/2012 :  04:25:57  Show Profile  Reply with Quote
sorted now.

I just edited the text field properties in the
dts package >>
Text File Source >>
Properties >> General tab >>
Properties >>
Fixed Field Column Positions (moved the sliding bar accordingly to the end of the data in the column.



mark.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52309 Posts

Posted - 11/05/2012 :  21:15:01  Show Profile  Reply with Quote
quote:
Originally posted by barnsley

sorted now.

I just edited the text field properties in the
dts package >>
Text File Source >>
Properties >> General tab >>
Properties >>
Fixed Field Column Positions (moved the sliding bar accordingly to the end of the data in the column.



mark.


hmm? does that mean your file was not delimited type?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

barnsley
Starting Member

31 Posts

Posted - 11/06/2012 :  05:04:14  Show Profile  Reply with Quote
the file type is .csv
the data in the file is in an excel spreadsheet and each data entry is on a separate line (not separated by commas).


mark.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52309 Posts

Posted - 11/06/2012 :  12:35:02  Show Profile  Reply with Quote
quote:
Originally posted by barnsley

the file type is .csv
the data in the file is in an excel spreadsheet and each data entry is on a separate line (not separated by commas).


mark.


then how will it be a csv?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

barnsley
Starting Member

31 Posts

Posted - 11/07/2012 :  03:57:17  Show Profile  Reply with Quote
i dont know.
in properties it just says this under type of file:
"Microsoft Excel Comma Separated Values File"
and file is called a.csv

mark.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000