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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Insert or update existing rows in encrypted table

Author  Topic 

Dadic
Starting Member

1 Post

Posted - 2009-11-19 : 15:18:07
Hi All,

I have little problem. I have an encrypted table (MSSQL 2005 Express, 3DES), with symmetric key. Everything works fine, I can decrypt the stored data (varbinary), but I can not insert new rows or update existing rows.

The encryption was made by this article:
http://dotnetslackers.com/articles/sql/IntroductionToSQLServerEncryptionAndSymmetricKeyEncryptionTutorial.aspx

When I want to insert new ros with this TSQL, the query will be successful, but, on the encrypted column will be NULL.

OPEN SYMMETRIC KEY symkeysecisa
DECRYPTION BY CERTIFICATE Secencisahungary
INSERT INTO TestTable (FirstCol,EncryptSecondCol)
SELECT 6, DECRYPTBYKEY('test')
GO

Can anybody help me?
   

- Advertisement -