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 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Importing CSV file - include/ignore white space

Author  Topic 

barnsley
Starting Member

34 Posts

Posted - 2012-11-02 : 11:52:08
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

52326 Posts

Posted - 2012-11-03 : 22:44:03
what have you defined as column delimiter?

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

Go to Top of Page

barnsley
Starting Member

34 Posts

Posted - 2012-11-05 : 04:25:57
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

52326 Posts

Posted - 2012-11-05 : 21:15:01
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

34 Posts

Posted - 2012-11-06 : 05:04:14
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

52326 Posts

Posted - 2012-11-06 : 12:35:02
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

34 Posts

Posted - 2012-11-07 : 03:57:17
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
   

- Advertisement -