Loading ...
Sorry, an error occurred while loading the content.

4882Re: [SQLQueriesNoCode] SQL Server 2012 Binary Text Field - convert to human readable HTML text

Expand Messages
  • Charles Carroll
    Feb 27, 2014
    • 0 Attachment
      It comes out the same so that data must not be binary :(

      I am leaning towards the idea the data is decrypted and encrypted by Cold Fusion and the person who said it was binary is just wrong.

      However some row data is HTML and some is this nonsense so that is a different sort of technical debt entirely.





      On Thu, Feb 27, 2014 at 12:49 PM, Paul Livengood <p_livengood@...> wrote:
       

      SELECT   A, B, CAST (C AS VARCHAR(MAX)), D
         



       From: Charles Carroll <seniorprogrammerguru@...>
      To: SQLQueriesNoCode@yahoogroups.com
      Sent: Thursday, February 27, 2014 10:37 AM
      Subject: Re: [SQLQueriesNoCode] SQL Server 2012 Binary Text Field - convert to human readable HTML text

       
      How would I cast inline if it is one of the select fields

      select
          a,b,c,d
      ...

      assuming it field c for example?



      On Thu, Feb 27, 2014 at 12:18 PM, Paul Livengood <p_livengood@...> wrote:
       
      have you tried casting it?

      declare @b varbinary(max)
      set @b = 0x5468697320697320612074657374

      select cast(@b as varchar(max))



      From: Charles Carroll <seniorprogrammerguru@...>
      To: sqlqueriesnocode@yahoogroups.com
      Sent: Thursday, February 27, 2014 10:12 AM
      Subject: [SQLQueriesNoCode] SQL Server 2012 Binary Text Field - convert to human readable HTML text

       
      I inherited a lousy database - 2nd normal form max, no documentation, most things done wrong.

      HTML in the DB is stored in a text field

      a. why not varchar(max)? That is what I will change it to.

      The text field appears to be binary i.e.
      PEZPTlQgc2l6ZT0zPiAKPFA+VG9 ...

      What is easiest way to convert it to text again?

      I am in SQL Server 2012 who knows what DB version they made it in 12 years ago...






    • Show all 8 messages in this topic