O'Reilly logo

Microsoft® SQL Server 2012 Unleashed by Alex T. Silverstein, Chris Gallelli, Paul T. Bertucci, Ray Rankins

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

Encrypting Columns Using a Passphrase

As our first example, let’s keep things simple and look at how to encrypt a column using a passphrase. To do so, let’s look at the Sales.CreditCard table, which currently stores card numbers in cleartext:

select top 5 * from Sales.CreditCardgoCreditCardID CardType       CardNumber     ExpMonth ExpYear ModifiedDate------------ -------------- -------------- -------- ------- -----------1            SuperiorCard   33332664695310 11       2006    2007-08-302            Distinguish    55552127249722 8        2005    2008-01-063            ColonialVoice  77778344838353 7        2005    2008-02-154            ColonialVoice  77774915718248 7        2006    2007-06-215            Vista          11114404600042 ...

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