Sometimes we need to hide some information of a database.
Here is a tip to encrypt a description of a view.

— Creating a table
create table MYTABLE
(
mycode  int
,myname  varchar(50)
,mysal   float
)

— Inserting values
insert into MYTABLE values (1,’sl4v3r’,6000)
insert into MYTABLE values (2,’james’,7000)
insert into MYTABLE values (3,’bond’,8000)

— Select the table
select *
from MYTABLE

1             sl4v3r    6000.0
2             james   7000.0
3             bond     8000.0

— Creating with encryption
CREATE VIEW vwMYTABLE
WITH ENCRYPTION
AS
SELECT MYCODE
,MYNAME
FROM MYTABLE

— Select the view
select *
from vwMYTABLE

1             sl4v3r
2             james
3             bond

— Getting Information
sp_helptext vwMYTABLE

The object comments have been encrypted.

See ya…😀