ENCRYPTION attribute causes the view definition to be stored as encrypted text. Without encryption, the definition would be viewable using the
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
IF EXISTS (SELECT * FROM sys.views WHEREobject_id= OBJECT_ID(N'[Sales].[vw_OrderSummary]'))DROP VIEW [Sales].[vw_OrderSummary]GOCREATE VIEW Sales.vw_OrderSummary ...