O'Reilly logo

SQL Server 2012 with PowerShell V3 Cookbook by Donabel Santos

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating symmetric and asymmetric keys

In this recipe, we will create symmetric and asymmetric keys.

Getting ready

In this recipe, we will use the TestDB database. If you don't already have this database, log in the SQL Server Management Studio and execute the following T-SQL code:

IF DB_ID('TestDB') IS NULL
CREATE DATABASE TestDB
GO

We will also need a user called eric in our TestDB database. This user will map to the SQL login eric. Feel free to create this user using the Creating a database user recipe. Alternatively, execute the following T-SQL code from SQL Server Management Studio:

Use TestDB
GO
CREATE USER [eric] 
FOR LOGIN [eric]

How to do it...

  1. Open the PowerShell console by going to Start | Accessories | Windows PowerShell | Windows PowerShell ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required