/*存储过程创建*/
USE [BookDB]
go
set ansi_nulls on
go
set quoted_identifier on
go
create procedure [dbo].[book_selectBookName]
@BookName varchar(100)
as
begin
select gi_xuetangzhishu.xietangbianhao,gi_xuetangzhishu.shiwumingcheng,gi_xuetangzhishu.xuetangzhishu,gi_type.type
from gi_xuetangzhishu,gi_type where gi_xuetangzhishu.typeid=gi_type.typeid
end
/*调用存储过程*/
exec book_selectBookName '2'
/*c创建视图*/
use [BookDB]
go
create view v_Name
as
select * from dbo.Book where BookName=123
/*调用视图*/
select * from v_Name