3

It's easy to encrypt column using query in SQL Server 2016 with "Always Encrypted". But we have existing tables. So how to encrypt a column in existing table? I need it using alter query.

I tried following Query

alter table testemp alter column ename  add ENCRYPTED WITH (
ENCRYPTION_TYPE = DETERMINISTIC,
ALGORITHM = 'AEAD_AES_256_CBC_HMAC_SHA_256',
COLUMN_ENCRYPTION_KEY = CEK_Auto8) 
Karthikeyan
  • 173
  • 4
  • 18

2 Answers2

2

See this artical How to configure Always Encrypted in SQL Server 2016 using SSMS, PowerShell and T-SQL in the Configuring Always Encrypted paragraph it states that

Defining column encryption on an existing database columns

can be done through Sql server management studio or PowerShell but not with T-SQL.

Dov Miller
  • 1,958
  • 5
  • 34
  • 46
0

You can encrypt columns in existing table using Sql server management studio.

Please check out this MSDN page

  • Can you clarify if this is the only way to accomplish? Can it not be done from T-SQL or .Net data provider? – explunit Oct 12 '17 at 16:10