1

I'm trying to encrypt the Email and LoweredEmail columns on a SQL database using Always Encrypted encryption using SSMS and I always get the same error:

Lock request time out period exceeded. There is no user table matching the input name '[dbo].[aspnet_Membership]' in the current database or you do not have permission to access the table. I still get the same error when I log in as the SA account, sio I guess that it's not a permissions problem.

SSMS select column SSMS key SSMS proceed SSMS summery SSMS error

EDIT *** Added the PowerShell Script

Generated by SQL Server Management Studio at 10:47 on 06/05/2021

Import-Module SqlServer

Set up connection and database SMO objects

$password = "" $sqlConnectionString = "Data Source=GALADRIEL\SKYLINE;Initial Catalog=SkylineMembership;User ID=sa;Password=$password;MultipleActiveResultSets=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;Packet Size=4096;Application Name="Microsoft SQL Server Management Studio"" $smoDatabase = Get-SqlDatabase -ConnectionString $sqlConnectionString

If your encryption changes involve keys in Azure Key Vault, uncomment one of the lines below in order to authenticate:

* Prompt for a username and password:

#Add-SqlAzureAuthenticationContext -Interactive

* Enter a Client ID, Secret, and Tenant ID:

#Add-SqlAzureAuthenticationContext -ClientID '' -Secret '' -Tenant ''

Change encryption schema

$encryptionChanges = @()

Add changes for table [dbo].[aspnet_Membership]

$encryptionChanges += New-SqlColumnEncryptionSettings -ColumnName dbo.aspnet_Membership.Email -EncryptionType Deterministic -EncryptionKey "CEK_Auto1" $encryptionChanges += New-SqlColumnEncryptionSettings -ColumnName dbo.aspnet_Membership.LoweredEmail -EncryptionType Deterministic -EncryptionKey "CEK_Auto1"

Set-SqlColumnEncryption -ColumnEncryptionSettings $encryptionChanges -InputObject $smoDatabase

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.