March 6, 2006 at 11:59 am
when I import data from a text file into sql server at the end of the row I am getting a box like of charecter. whats that character?
thanks.
March 6, 2006 at 12:25 pm
it is most likely ascii characters, you should be able to use the ascii function in conjunction with the replace function to get rid of these. Should be able to include this in the import job.
March 6, 2006 at 1:17 pm
Sounds like your typical end of line character.......which would be CHAR(10) and/Or CHAR(13)
March 6, 2006 at 1:25 pm
It may be any of non-printable charachters.
It's just the way EM displays presence of such charachters.
_____________
Code for TallyGenerator
March 6, 2006 at 2:16 pm
Yes,
It's a non-printabla character and can only be viewed in EM not in query analyzer.
Whatcan we call that number?
What would be the ascii number for that character.(its neither char(10) not char(13))
Thanks.
March 6, 2006 at 4:30 pm
> What would be the ascii number for that character.
You have the data, so you can go look -- people here do not have the data, so they cannot say.
I'd suggest looking at the source in a binary (hex) editor -- or as someone has suggested, you could use a T-SQL query to find out.
March 6, 2006 at 6:28 pm
Hilight the character, copy it, and paste it into the 'X' below in QUERY ANALYZER... it'll tell you what the character number is...
SELECT ASCII('X')
--Jeff Moden
Change is inevitable... Change for the better is not.
March 6, 2006 at 6:41 pm
It will not work this way.
You will see the code of EM replacement character, not the one has been replaced.
SELECT ASCII(SUBSTRING(<ColName>, <StartPosition>, 1))
_____________
Code for TallyGenerator
March 7, 2006 at 5:09 am
Haven't tried it in Enterprise Manager... works fine in Query Analyzer...
--Jeff Moden
Change is inevitable... Change for the better is not.
March 7, 2006 at 6:56 am
Just to pitch in
SELECT CAST([columnname] as varbinary(8000))
will display the string in hex and you can see what and how many non printable chars (typically less than 0x20) are at the end of the string
Far away is close at hand in the images of elsewhere.
Anon.
March 7, 2006 at 4:38 pm
Now there's an idea... thanks for pitching in... hadn't thought about that approach.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 11 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply