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
 Transact-SQL (2000)
 Square symbols after data?

Author  Topic 

chriskhan2000
Aged Yak Warrior

544 Posts

Posted - 2005-05-13 : 09:48:27
I'm getting squares at the end of the data when I convert a binary field (image type) into strings. Anyone knows how to get rid of them? I tried using RTRIM, but that doesn't work.

Here's my query:

SELECT (CAST(CAST(BITS AS BINARY(8000)) AS VARCHAR(40))) AS
DESCRIPTION
FROM BINARY_BITS

nr
SQLTeam MVY

12543 Posts

Posted - 2005-05-14 : 17:08:53
They're characters that can't be displayed.
see
http://www.mindsdoor.net/SQLTsql/RemoveNonNumericCharacters.html

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

chriskhan2000
Aged Yak Warrior

544 Posts

Posted - 2005-05-16 : 09:37:04
Thanks for the response and link. These characters do not show in Query Analyzer, but when view in Reporting Services, it display squares at the end. The example from that link does seem like it will work, but it will remove all non numbers or alpha characters. Meaning like if I have decimal numbers or qoutation marks, it will remove it all, which is not what I want.

I just want it to trim right and trim anything at end of the characters. Is this possible?
Go to Top of Page
   

- Advertisement -