create view users_view1 with encryption --加密 as select username,pwd from users GO
create view sex_view3 as select a.work_id,work_name,sex,position,ware_id,sell_price from worker a,sell b where a.work_id=b.work_id and sex=1 goselect * from sex_view3
create view price_view1 as select work_id,sum(sell_price) from sell group by work_id
例:在sex_view3視圖中建立⼀一個能顯⽰示職員編號、姓名及性別的視圖。 create view sex_view4 as select work_id,work_name,sex from sex_view3
alert view sex_view1 as select * from where sex = 0 go
drop view sex_view1
查看視圖信息 SP_HELP + 視圖名sql
查看視圖的定義腳本 SP_HELPtext +視圖名函數
更改視圖名字 SP_RENAME + 舊視圖名,新視圖名加密
查詢:select 插入:insertspa
更新:update 刪除:deletecode
creat view Work_view5 as select * from worker go alert view work_view5 as select * from worker where work_name = '業務員' go