I have setup a Azure SQL Database and enabled Always Encrypted.
One of the column (column3) is varchar(Max)
.
When I query the database from SSMS without using "column encryption setting=enabled"
, I can see that all the columns have binary data.
When I query the database from SSMS using "column encryption setting=enabled"
, I am getting an error as below:
An error occurred while executing batch. Error message is: Retrieving encrypted column 'column3' with CommandBehavior=SequentialAccess is not supported.
This is what my table definition looks like:
CREATE TABLE [dbo].[mytable](
[column1] [varchar](2000) ENCRYPTED WITH (COLUMN_ENCRYPTION_KEY = [CEK_Auto1], ENCRYPTION_TYPE = Deterministic, ALGORITHM = 'AEAD_AES_256_CBC_HMAC_SHA_256') NULL,
[column2] [datetime] ENCRYPTED WITH (COLUMN_ENCRYPTION_KEY = [CEK_Auto1], ENCRYPTION_TYPE = Deterministic, ALGORITHM = 'AEAD_AES_256_CBC_HMAC_SHA_256') NULL,
[column3] [varchar](max) ENCRYPTED WITH (COLUMN_ENCRYPTION_KEY = [CEK_Auto1], ENCRYPTION_TYPE = Deterministic, ALGORITHM = 'AEAD_AES_256_CBC_HMAC_SHA_256') NULL
)
If I remove the encryption on column3, everything works fine and I can see decrypted values.
Am I missing something here?