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 2005 Forums
 Transact-SQL (2005)
 Unusual character in data field

Author  Topic 

SQL_DI
Starting Member

5 Posts

Posted - 2009-07-01 : 15:35:11
I am bcp'in a table out into a tab delimited text file. When I open up the file with textpad, I am getting a | in an empty field. When I open up the file in word and use the show control characters, I get a Y with two dots on top. Never seen this one before. can I use the char() function to remove this. The only options I see in BOL are 9 for tab, 10 for line feed, and 13 for carriage return.

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-07-01 : 15:38:31
In Textpad you have the chance to identify that special record an select it from table?


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-07-01 : 15:44:51
select ascii('ÿ')
gives 255.
That's another kind of space.
replace(column,char(255),' ')


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

SQL_DI
Starting Member

5 Posts

Posted - 2009-07-01 : 15:48:07
Yes, the attribute does not have anything in it for that record that I can see.
Go to Top of Page

SQL_DI
Starting Member

5 Posts

Posted - 2009-07-01 : 15:51:54
It's still there
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-07-01 : 15:59:34
What datatype is that column?


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2009-07-01 : 17:07:02
quote:
Originally posted by webfred

What datatype is that column?


No, you're never too old to Yak'n'Roll if you're too young to die.



varchar

You want to sanitize the data?

Is the data coming from user entry?

From a different source system?

Make the business or feeding systems clean up the data...or don't worry, be happy

Is it causing any problems?

ANY of the usual CHAR suspects in an exporet to a delimited file can cause you problems

Try a delimiter of "|~|"

That should be safe



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-07-01 : 17:14:33
quote:
Originally posted by SQL_DI

It's still there


replace(column,char(159),' ')



No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

SQL_DI
Starting Member

5 Posts

Posted - 2009-07-01 : 17:56:46
It's a varchar(60). I have a file created a few years back that has the same data, but it does not have this problem. I am wondering if it came about during a migration to 2005. CHAR(159) di not work either.
Go to Top of Page
   

- Advertisement -