Microsoft® SQL Server 2012 Unleashed
by Ray Rankins, Paul T. Bertucci, Chris Gallelli, Alex T. Silverstein
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 ...
Become 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,
and much more.
Read now
Unlock full access