1

It's possible to use either the Encrypt Columns wizard in SSMS or Powershell to encrypt the data in Always Encrypted columns but can you use T-SQL for this?

To be clear, I don't want to create keys or columns that support encrypted columns, I want to complete the actual data encryption commensurate to the Set-SqlColumnEncryption cmdlet in Powershell but with T-SQL.

dhughes
  • 645
  • 1
  • 7
  • 19
  • The whole idea of Always Encrypted is that (only) the client has the encryption key, not the server. If pure T-SQL could encrypt or decrypt the data, it would imply the scheme is broken. The closest you can get is encrypting the data yourself, then using the `ALLOW_ENCRYPTED_VALUE_MODIFICATIONS` permission to directly set the encrypted values -- this you could do using T-SQL. Conceivably even the encryption itself, but, again, that would be insecure by design because it means the server has access to both the plaintext and the key. – Jeroen Mostert May 08 '18 at 07:01

0 Answers0