首页 新闻 会员 周边 捐助

求大神,帮我看下,我的语句哪里问题,怎么改!!!!

0
悬赏园豆:10 [待解决问题]

create database chap2;
use chap2;
create table qcjbxxb (
cph varchar(50) primary key,
qczl varchar(50),
zdzkl varchar(50),
bc varchar(50),
s_name varchar (50)
);
create table cpxxb (
cpbh varchar(50) primary key,
czcs int,
pj int,
bch varchar(50),
yszw int,
yp int,
cfsj varchar(50),
cfd varchar(50),
mdd varchar(50),
glxm varchar(50)
);
create table bcxxb (
bch varchar(50) primary key,
cfd varchar(50),
mdd varchar(50),
cfsj varchar(50),
dzsj varchar(50),
czcs int,
glyxm varchar(50)
);
create table ckxxb (
ckxm varchar(50)primary key,
cpbh varchar(50),
xb varchar(50),
csrq varchar(50)
);
create table czb (
bch varchar(50)primary key,
cfd varchar(50),
mdd varchar(50),
cfsj varchar(50),
dzsj varchar(50),
cph varchar(50),
ckxm varchar(50)
);
create table sjxxb (
s_name varchar(50)primary key,
xb varchar(50),
csrq varchar(50),
jszh varchar(50),
sj varchar(50)
);
create table kyzgly (
glyxm varchar(50),
mm nchar(10)
);
create table xtgly (
dlm nchar(10),
mm nchar(10)
);
create view view_
as select dbo.bcxxb.mdd,dbobcxxb.bch,dbo.bcxxb.cfd,dbo.bcxxb.glyxm,dbo.qcxxb.cph,dbo.qcxxb.qczl,dbo.sjxxb.s_name
from dbo.bcxxb
inner join dbo.qcxxb
on dbo.bcxxb.bch=dbo.qcjbxxb.bch
inner join dbo.sjxxb
on dbo.qcxxb.s_name=dbo.sjxxb.s_name;
SET ansi_nulls on 
go
set quoted_identifier on
go
alter trigger[dbo].[c]
on[dbo].[ckxxb]for insert
as
if exists(select*from dbo.ckxxb,dbo.cpxxb where dbo.cpxxb.cpbh=dbo.ckxxb.cpbh)
begin
update dbo.cpxxb
set yszw=yszw+1,yp=yp-1
where cpbh=(select cpbh from inserted)
end
crytckxx
insert into dbo.ckxxb
values('陆的','00006','男','1993');
set ansi_nulls on 
go
set quoted_identifier on
go
alter trigger [dbo].[b]
on [dbo].[czb] for insert
as
if exists(select*from dbo.czb,dbo.bcxxb where dbo.bcxxb.bxh=dbo.czb.bch)
begin
update dbo.bxxxb
set czcs=czcs+1
where bch=(select bch from inserted)
end
crytczxx
insert into dbo.czb
values('0006','洛阳','西安','14;00','19;00','011','陆平');

 

 这是我的程序代码 


有几处错误我不知道怎么修改 
 

 

我忒忙的主页 我忒忙 | 初学一级 | 园豆:28
提问于:2016-06-19 13:54
< >
分享
所有回答(1)
0

你根据提示来吧。一大段代码,实在是看不下去。

幻天芒 | 园豆:37207 (高人七级) | 2016-06-19 16:45

提示在哪???

支持(0) 反对(0) 我忒忙 | 园豆:28 (初学一级) | 2016-06-20 09:12

@我忒忙: 执行sql的时候,会有错误提示的。

支持(0) 反对(0) 幻天芒 | 园豆:37207 (高人七级) | 2016-06-20 13:09
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册