我们在文本大小较小的列上成功实现了SQL TDE(SQL 2016(,但在大列上会出错
表结构
ID - value
1 - wanted to confirm her order for the install, adv that the activation date was set
2 - Edward called to have his order processed. Order processed for 20M, leased modem and self install. Due date for the above to be renewed in end of the year
3 - was unable to transfer, no one answered, customer said that they have mpvs' number
4- Placed order for modems
ALTER TABLE [TextValues]
add value_encrypt varbinary(max)
go
UPDATE [TextValues]
SET value_encrypt=EncryptByKey (Key_GUID('SymKey_Encryption'), value)
FROM [TextValues];
"错误:"字符串或二进制数据将被截断。声明已终止"。
您的问题与TDE无关。TDE是一种低级别存储加密选项,它在不更改应用程序代码的情况下透明地加密静止数据(即数据库文件中的数据(。
ENCRYPTBYKEY
T-SQL函数以编程方式加密数据。此函数返回varbinary(8000)
结果。当加密的值超过8000字节时,您将得到一个截断错误,因此这不能用于加密大值。
如果您的目标是保护静止的数据,那么TDE是最容易实现的,因为不需要更改代码。数据可以通过TLS加密进行进一步的保护。