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

ENCRYPTION

The ENCRYPTION attribute causes the view definition to be stored as encrypted text. Without encryption, the definition would be viewable using the sys.syscomments or sys.sql_modules catalog view. This feature is also available for stored procedures and other database code that you may want to protect. One issue to consider when you create a view using the ENCRYPTION option is that this option prevents the view from being published as part of SQL Server replication.

The following example shows the creation of one of the prior views with the ENCRYPTION attribute:

IF  EXISTS (SELECT * FROM sys.views WHEREobject_id= OBJECT_ID(N'[Sales].[vw_OrderSummary]'))DROP VIEW [Sales].[vw_OrderSummary]GOCREATE VIEW Sales.vw_OrderSummary ...

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