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
 Development Tools
 Reporting Services Development
 Convert Binary has weird symbol

Author  Topic 

chriskhan2000
Aged Yak Warrior

544 Posts

Posted - 2005-04-21 : 10:08:52
Anyone has converted binary and not getting any weird symbols? I have a binary field with image type which I'm trying to convert into text. However after the text, I'm getting squares following.

How can I get rid of this in SQL level or Reporting Services level. Tried doing a RTRIM, but that doesn't seem to work.

Any ideas?

chriskhan2000
Aged Yak Warrior

544 Posts

Posted - 2005-04-21 : 11:04:32
This is shown in Visual Studio 2003, but once deployed, it seems to disappear. So not sure if it's a bug between Visual Studio and RS or what.
Go to Top of Page

jhermiz

3564 Posts

Posted - 2005-04-21 : 16:35:36
Did you try the replace function ? Usually the square symbol is CHR(13) (VB) or \n (in C++ / C) vbCrLf or vbNewLine.
You might be able to parse it out using the REPLACE() function.



Keeping the web experience alive -- [url]http://www.web-impulse.com[/url]
Imperfection living for perfection --
[url]http://jhermiz.blogspot.com/[/url]
Go to Top of Page

chriskhan2000
Aged Yak Warrior

544 Posts

Posted - 2005-04-22 : 16:13:17
I had not try that, but it is something I will look into. THanks.
Go to Top of Page

chriskhan2000
Aged Yak Warrior

544 Posts

Posted - 2005-05-05 : 16:35:30
Jon,

You say to use the Replace function, how would I go about doing that within SQL?

I check the bookonline and it says taht i can use:

SELECT REPLACE('12345', '34', 'ab')

and get this result: 12ab5

But I don't know how that applies to my query.


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

BTW this works fine in query analyzer. It's just not working in Reporting Services, which gives me the squares. Data type for the BITS field is image if that will help.
Go to Top of Page
   

- Advertisement -