VC++ 执行SQL语句问题,如何声明变量?
CREATESYMMETRICKEYkey1WITHALGORITHM=DESENCRYPTIONBYPASSWORD='1234aaa'GOOPENSYMMETRICK...
CREATE SYMMETRIC KEY key1 WITH ALGORITHM=DES
ENCRYPTION BY PASSWORD='1234aaa'
GO
OPEN SYMMETRIC KEY key1
DECRYPTION BY PASSWORD='1234aaa'
DECLARE @str NVARCHAR(100),@Encrypted VARBINARY(MAX)
SET @str=N'aaaaa'
SELECT @Encrypted=ENCRYPTBYKEY(KEY_GUID('key1'),@str)
SELECT '加密'=@Encrypted ,'解密'=CAST(DECRYPTBYKEY(@Encrypted) AS NVARCHAR(100))
CLOSE SYMMETRIC KEY key1
GO
DROP SYMMETRIC KEY key1
GO
我想把这个在VC里边执行。。。。 展开
ENCRYPTION BY PASSWORD='1234aaa'
GO
OPEN SYMMETRIC KEY key1
DECRYPTION BY PASSWORD='1234aaa'
DECLARE @str NVARCHAR(100),@Encrypted VARBINARY(MAX)
SET @str=N'aaaaa'
SELECT @Encrypted=ENCRYPTBYKEY(KEY_GUID('key1'),@str)
SELECT '加密'=@Encrypted ,'解密'=CAST(DECRYPTBYKEY(@Encrypted) AS NVARCHAR(100))
CLOSE SYMMETRIC KEY key1
GO
DROP SYMMETRIC KEY key1
GO
我想把这个在VC里边执行。。。。 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询