December 12, 2008 at 5:12 am
Hi Proz,
I have two databases (DB1 & DB2) in same server. I had created symmetric key 'DB1Key' & certificate 'DB1Cert' to DB1 thus the encryption & decryption works fine at DB1.
Now my problem is i try to open the key & use the certificate at DB2 but get this error: " Cannot find the symmetric key 'DB1Key', because it does not exist or you do not have permission."
I need to decrypt the DB1's data at DB2. Example:-
-- Database at DB2
OPEN SYMMETRIC KEY DB1Key
DECRYPTION BY CERTIFICATE DB1Cert;
SELECT CONVERT(varchar(max),DecryptByKey(SCCode)) FROM DB1.dbo.Security_Code
CLOSE SYMMETRIC KEY DB1Key
Anyway to solve this problem? Thanks! 🙂
December 12, 2008 at 7:33 am
I believe the key is at the database level so is not available in another database. You would need to do it all in DB1. I;d create a procedure in DB1 that I call from DB2.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
December 13, 2008 at 7:19 am
Thanks. That's what i did to temporarily solved the problem. Really don't have other ways to encounter this? Like copy the key & certificate to DB2?
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply