View WITH ENCRYPTION
View WITH ENCRYPTION is a SQL statement in the Views category. SQL Server: encrypts the view definition so it cannot be viewed via sp_helptext or object_definition. The syntax is CREATE VIEW view_name WITH ENCRYPTION AS select_statement;. It returns encrypted view. A typical example: CREATE VIEW employee_salaries WITH ENCRYPTION AS SELECT name, salary FROM employees; -- Definition is encrypted and hidden -- Even sysadmin cannot see the original CREATE statement A close relative is CREATE VIEW, which creates a virtual table based on a SELECT query. Think of it as a saved query that acts like a table. A close relative is DROP VIEW, which removes a view from the database. Does not affect the underlying tables. A close relative is ALTER VIEW, which modifies an existing view definition. More about this category: Database views — CREATE VIEW, DROP VIEW, ALTER VIEW, materialized views. Related Views entries: CREATE VIEW, DROP VIEW, ALTER VIEW, MATERIALIZED VIEW, CREATE OR REPLACE VIEW, WITH CHECK OPTION, INDEXED VIEW (WITH SCHEMABINDING), View WITH READ ONLY.