Encrpted Columns in Table

  • When I run the following it only returns one character for the surname field.

    Any Ideas why I'm not geting the full surname.

    USE Encrypteddb

    GO

    OPEN MASTER KEY DECRYPTION BY PASSWORD = 'Masterkeypassword'

    OPEN SYMMETRIC KEY EncryptionKey

    DECRYPTION BY CERTIFICATE EncryptionCertificate;

    SELECT CONVERT(VARCHAR(500),DECRYPTBYKEY(surname)) AS surname, *

    FROM dbo.encrypted_table

    GO

  • The surname column is varbinary(200) in the table.

  • Coverting to Nvarchar resolved the issue.

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

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