book
Microsoft® SQL Server 2012 Unleashed
by Ray Rankins, Paul T. Bertucci, Chris Gallelli, Alex T. Silverstein
December 2013
Intermediate to advanced
1872 pages
153h 31m
English
Content preview from Microsoft® SQL Server 2012 UnleashedBecome an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
Start your free trial



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 ...