| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1468 人关注过本帖
标题:这两个表如何写触发器
取消只看楼主 加入收藏
wsq1168
Rank: 1
等 级:新手上路
帖 子:72
专家分:0
注 册:2007-8-24
收藏
 问题点数:0 回复次数:1 
这两个表如何写触发器
当借阅发生时,在书的信息表里的现存量自动减1,用触发器如何实现
create table  bookborrow--借阅图书
(
    bookborrow_id int primary key,
    book_ISDN char(20) ,--书编号
    member_id char(10) ,--会员编号   
    book_borrowdate smalldatetime,--借书日
    book_maturedate smalldatetime,--到期日
    book_num smallint,--借书数量
   
)

create table bookinformation--书的信息
(
    book_ISDN  nvarchar(50) primary key ,--书ISDN  
    book_name nvarchar(50)not null,--书名
  bookclass_id int not null,--数类别
    book_writer nvarchar(20)not null,--书作者   
    bookpublish_time datetime not null,--书发行时间
    bookpublisher nvarchar(20),--书发行者,
    book_money money not null,--书的价格
    book_amount smallint,--库存总量
    book_residual smallint,--现存量
    book_information ntext,--书的信息
   
)
搜索更多相关主题的帖子: 触发器 
2007-12-12 20:45
wsq1168
Rank: 1
等 级:新手上路
帖 子:72
专家分:0
注 册:2007-8-24
收藏
得分:0 
给写一个
给写一个
2007-12-13 12:58
快速回复:这两个表如何写触发器
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.015435 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved