Problem with data conversion.

  • Hi,

    plz see dis simple script. What's going wrong with the varbinary data while converting to float?? Here I used the built-in encryption-decryption functions in 2005 which returns varbinary.

    Plz help

    declare @a varbinary(100)

    declare @b-2 varbinary(100)

    declare @f float

    set @f=123.456

    set @a=EncryptByPassPhrase('vival', cast(@f as varbinary))

    set @b-2=DecryptByPassPhrase('vival', @a)

    print @b-2

    print cast(cast(@b as decimal(10,4)) as float)

  • Please don't cross post. It just wastes peoples time and fragments replies.

    No replies to this thread please. Direct replies to:http://www.sqlservercentral.com/Forums/Topic615953-1291-1.aspx

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply