As
Select bookid,pubname,bookauthor,bookname,searchNO
FROM BOOKINFO
WHERE bookname=’ASP程序设计’;
创建关于用户名的视图,因为查询时需要绑定。
Create view user_name
As
Select userid,username,phone,address,email
FROM users
WHERE username=’
4.7 创建存储过程
创建建表的存储过程
USE LIBRARY
GO
CREATE PROCEDURE createtables
AS
CREATE TABLE BookInfo
( bookid int(4) NOT NULL UNIQUE ,
bookname varchar(100) ,
pubname varchar(100) ,
bookauthor varchar(50) ,
series varchar(50) ,
ISBN varchar(50) ,
SearchNO varchar(50) ,
PubDate smalldatetime(4) ,
Price float(8) ,
Barcode varchar(50)
);
CREATE TABLE LendInfo
(
LendID int(4) NOT NULL UNIQUE ,
BookID int(4) NOT NULL UNIQUE ,
UserID varchar(50) NOT NULL UNIQUE ,
LendDate smalldatetime(4) ,
ReturnDate smalldatetime(4) ,
IsBack int(4)
);
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] ... 下一页 >>