一:简单的视图
use xland
go
create view my_vw
as
select a.id, a.title,u.username from mytable a join [user] u on u.id = a.uid
go
create view my_vw
as
select a.id, a.title,u.username from mytable a join [user] u on u.id = a.uid
执行这个视图
二:删除和修改视图
alter view yourviewname as...
drop view yourviewname as...
use xland
go
select * from my_vw
结果跟直接运行go
select * from my_vw
select a.id, a.title,u.username from mytable a join [user] u on u.id = a.uid
是一样的二:删除和修改视图
alter view yourviewname as...
drop view yourviewname as...
三:加密视图
alter view yourviewname with encryption as...
加密了之后连你自己也看不到原代码了
alter view yourviewname with encryption as...
加密了之后连你自己也看不到原代码了