|
-
Jan 29th, 2008, 02:37 AM
#1
Thread Starter
Fanatic Member
Encrypt KEY
I have made sp as follows
create PROCEDURE [dbo].[ProcMyProc](@ClearText nvarchar(50))
AS
BEGIN
OPEN SYMMETRIC KEY MyKey DECRYPTION BY PASSWORD= 'MY_Password_128';
grant view definition on symmetric key ::MyKey to OUTSOURCE/VerticityDev
Declare @Temp varbinary(8000);
Set @Temp =EncryptByKey(Key_GUID('MyKey'),@ClearText);
--close symmetric key MyKey;
select @Temp as temp;
END
exec [dbo].[ProcMyProc] 'ERUM'
sp is created successfully but when i run it ,it says
Msg 15151, Level 16, State 1, Procedure ProcMyProc, Line 4
Cannot find the symmetric key 'MyKey', because it does not exist or you do not have permission.
Msg 15151, Level 16, State 1, Procedure ProcMyProc, Line 5
Cannot find the symmetric key 'MyKey', because it does not exist or you do not have permission.
any urgent help would highly appreciated
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|