How to use Always Encrypted feature with temp table

Surapally Sravan Kumar 0 Reputation points
2024-07-09T08:03:52.1333333+00:00

Hi,We are using Always Encryption in our Azure SQL hosted database(PaaS) and when we are using temp table in an stored procedure which is being used to store and Join with encrypted table's column for UPDATE/INSERT operation, getting error : 'Msg 33293 Level 16 Cannot find the column encryption key because it does not exists or you do not have permissions'.

Azure SQL Database
{count} votes

1 answer

Sort by: Most helpful
  1. ShaktiSingh-MSFT 14,701 Reputation points
    2024-07-09T08:56:25.29+00:00

    Hi Surapally Sravan Kumar •,

    Welcome to Microsoft Q&A forum.

    As I understand, you are getting error 'Msg 33293 Level 16 Cannot find the column encryption key because it does not exists or you do not have permissions' in Azure SQL DB.

    Please try creating of CMK and CEK in tempdb as described here in the article:

    https://dba.stackexchange.com/questions/187548/can-sql-server-always-encrypted-be-used-for-temporary-tables

    Also refer to similar post here and let us know if this helped.

    Thanks