Performing encryption operations

Aluwani Nethavhakone - BCX 21 Reputation points
2021-03-24T14:43:39.007+00:00

Mar 24 2021 16:39:16 [Informational] WorkitemExecution: Message:Work item 'Performing encryption operations' started..

Mar 24 2021 16:39:16 [Informational] TaskUpdates: Message:Task: 'Performing encryption operations' -- Status: 'Started' -- Details: 'Task 'Performing encryption operations' started ....'.

Mar 24 2021 16:39:33 [Informational] TaskUpdates: Message:Task: 'Performing encryption operations' -- Status: 'Failed' -- Details: 'Task failed due to following error: Loading source as a script-backed model failed due to the following errors:
Error SQL70590: Must declare the variable or parameter "@count"
'.

Mar 24 2021 16:39:33 [Informational] WorkitemExecution: Message:Work item 'Performing encryption operations' stopped..

Mar 24 2021 16:39:33 [Error] WorkitemExecution: Message:Work item 'Performing encryption operations' did not complete. Details: Loading source as a script-backed model failed due to the following errors:
Error SQL70590: Must declare the variable or parameter "@count"
.

Mar 24 2021 16:39:33 [Informational] Log Closed: Message:Job processing completed.

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,654 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,355 questions
{count} votes

2 answers

Sort by: Most helpful
  1. AmeliaGu-MSFT 13,961 Reputation points Microsoft Vendor
    2021-03-25T07:46:29.65+00:00

    Hi AluwanNethavhakoneBCX-4502,

    Could you please share us the steps and the powershell script when configuring Always Encrypted?
    Please follow this doc to check if there are any unsupported characteristics for the columns and use SSMS 18.8 to configure it.
    And please refer to this guide which might help.

    Best Regards,
    Amelia

    0 comments No comments

  2. Aluwani Nethavhakone - BCX 21 Reputation points
    2021-03-25T09:02:22.583+00:00

    Hi AmeliaGu-msft

    Thanks for prompt respond.

    I followed the steps in above link.

    Powershell steps.

    Import-Module SqlServer
    $password = "mypassword"
    $sqlConnectionString = "Data Source=mydata;Initial Catalog=myDatabase;User ID=myUser;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
    $encryptionChanges = @()
    $encryptionChanges += New-SqlColumnEncryptionSettings -ColumnName dbo.BRAC_CUST_ACCT_MOP.CC_NO -EncryptionType Deterministic -EncryptionKey "CEK_Auto1"

    Set-SqlColumnEncryption -ColumnEncryptionSettings $encryptionChanges -InputObject $smoDatabase

    After the last command i get
    81457-power-shell-1.png

    Then get this error.
    81511-powershell-error.png

    0 comments No comments