SQL can encrypt the view. That is, you can permanently hide the text of a view definition.
Note This action is not reversible. After you encrypt the view, you cannot modify it again because the view definition is no longer visible. If you need to modify the encrypted view, you must delete it and recreate the other view.
Example code:
Create ViewUserft asSelectusers.userid,users.username,users.ftnum,ft. Subject,ft. Content fromUsersInner JoinFt onUsers.userid=Ft.useridGoAlter ViewUserft withEncryption--Encrypt a view asSelectusers.userid,users.username,users.ftnum,ft. Subject,ft. Content fromUsersInner JoinFt onUsers.userid=Ft.useridGo--Delete TriggerDrop ViewUserft
Enterprise Manager Encryption View
- In Server Explorer, ensure that the data Connections node is expanded, and that the node for the specific connection is expanded.
- Expand the Views node, right-click the target view, and choose Design View from the shortcut menu.
- Right-click the background of the Diagram pane and select Property Pages from the shortcut menu.
- Select Encrypt view, and then click Close. V
SQL Server Foundation SQL view encryption, permanently hides the text of the view definition