如何在sql server中将透明数据导出到加密数据库

时间:2015-06-29 10:19:39

标签: mysql sql sql-server sql-server-2012

我想将透明数据从数据库移动/复制到具有相同表格结构但已加密的另一个数据库。我怎么能做这份工作?

1 个答案:

答案 0 :(得分:0)

简而言之

OPEN SYMMETRIC KEY [*YourKeyName*]
DECRYPTION BY CERTIFICATE [*YourCertName*]
GO

DECLARE @Key_Guid AS UNIQUEIDENTIFIER
SET @Key_Guid = key_guid('*YourKeyName*')

IF( @Key_Guid is not null )
BEGIN
    <*Perform your Insert here*>
END

CLOSE SYMMETRIC KEY *YourKeyName*
GO

以下是一些值得一试的参考资料: SQLServerCentral articleTransparent Data EncryptionSQL Server Security Statementsstackoverflow article