Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Encrpted Columns in Table Expand / Collapse
Author
Message
Posted Monday, November 5, 2012 2:56 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Friday, February 22, 2013 9:22 AM
Points: 63, Visits: 224
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
Post #1380943
Posted Monday, November 5, 2012 3:57 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Friday, February 22, 2013 9:22 AM
Points: 63, Visits: 224
The surname column is varbinary(200) in the table.
Post #1380965
Posted Monday, November 5, 2012 9:11 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Friday, February 22, 2013 9:22 AM
Points: 63, Visits: 224
Coverting to Nvarchar resolved the issue.
Post #1381144
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse