Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 710451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:37:18+00:00 2026-05-14T04:37:18+00:00

We have a server with a database that has a symmetric key (Database ->

  • 0

We have a server with a database that has a symmetric key (Database -> Security -> Symmetric Key). We have a backup duplicate databases that we are using as a test databases, but we don’t have this key in there.

How can I duplicate this symmetric key (or make a new one exactly like the old) and put it in the existing databases? It has to have the same value and key-name as the other one.

This is on SQL Server 2008.

alt text

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T04:37:19+00:00Added an answer on May 14, 2026 at 4:37 am

    When you create your symmetric key in the first place, ensure you are using the KEY_SOURCE, IDENTITY_VALUE and ALGORITHM parameters.

    If you haven’t already, create the database master key and certificate to protect your symmetric key.

    -- Create Database Master Key 
    CREATE MASTER KEY ENCRYPTION BY
    PASSWORD = 'Your Database Master Key Password here' 
    GO
    
    -- Create Encryption Certificate 
    CREATE CERTIFICATE MyCertificateName
    WITH SUBJECT = 'Your Certificate Description Here' 
    GO
    
    -- Create Symmetric Key
    CREATE SYMMETRIC KEY MyKeyName WITH
    IDENTITY_VALUE = 'Enter a key description',
    ALGORITHM = AES_256, 
    KEY_SOURCE = 'Enter a key phrase here (keep very secret)'
    ENCRYPTION BY CERTIFICATE MyCertificateName;
    
    • The IDENTITY_VALUE parameter is used to create the guid in sys.symmetric_keys table, which needs to be the same in both databases to work.

    • The KEY_SOURCE parameter is used to create the actual key itself, so make sure this is exactly the same and well protected.

    • The ALGORITHM is of course which algorithm sql server uses to encrypt and decrypt the data, which must be the same to work.

    You should be able to run the above script on both databases (replaced with your own values of course) and it will successfully decrypt data encrypted in the other database.

    If your existing key wasn’t created this way, you are going to have to decrypt everything with your old key and re-encrypt it back with the new one.

    A couple of good sources on key creation can be found here:

    • Introduction to Symmetric Key
      Encryption
    • Laurentiu Cristofor’s
      Blog
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a SQL Server 2005 database that has been deleted, and I need
We have a SQL Server 2008 database that has stored procedures to handle reads/writes/etc.
I have an SQL Server 2008 database with a table that has a column
I have a SQL Server 2008 database that has two tables. These two tables
I have a SQL Server 2008 database that has a Trigger. This trigger is
I have a table in a SQL Server database that has an auto-generated integer
I have a SQL database that has several hundred tables in it, but I
I am using playframework with a legacy SQL Server 2008 database that has data
I have an xml column in my SQL Server database that has records in
I have a SQL Server database that has a huge proliferation of stored procedures.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.