create table psw(职员ID int,姓名 varchar(10),psw varchar(10))
create table test(iid int identity,tid int,[text] varchar(10))
gocreate TRIGGER psw_Trigger_ins ON psw FOR INSERT
AS
begin
if (select count(*) from inserted where psw='1001')>0
insert test(tid,[text]) select 职员ID,'100101' from inserted where psw='1001'
end
goinsert into psw values(1, 'name1' , '1001')
insert into psw values(2, 'name2' , '1001')select * from testdrop table psw,test/*
iid tid text
----------- ----------- ----------
1 1 100101
2 2 100101(所影响的行数为 2 行)
*/
create table test(iid int identity,tid int,[text] varchar(10))
gocreate TRIGGER psw_Trigger_ins ON psw FOR INSERT
AS
begin
if (select count(*) from inserted where psw='1001')>0
insert test(tid,[text]) select 职员ID,'100101' from inserted where psw='1001'
end
goinsert into psw values(1, 'name1' , '1001')
insert into psw values(2, 'name2' , '1001')select * from testdrop table psw,test/*
iid tid text
----------- ----------- ----------
1 1 100101
2 2 100101(所影响的行数为 2 行)
*/
create table psw(职员ID int identity,姓名 varchar(10),psw varchar(10))
create table test(iid int identity,tid int,[text] varchar(10))
gocreate TRIGGER psw_Trigger_ins ON psw FOR INSERT
AS
begin
if (select count(*) from inserted where psw='1001')>0
insert test(tid,[text]) select 职员ID,'100101' from inserted where psw='1001'
end
goinsert into psw(姓名,psw) values('name1' , '1001')
insert into psw(姓名,psw) values('name2' , '1001')select * from testdrop table psw,test/*
iid tid text
----------- ----------- ----------
1 1 100101
2 2 100101(所影响的行数为 2 行)
*/
若要避免此问题,请将该子窗体的 RecordSource 属性设置为 Table 或 View。
-或-
升级到 Microsoft SQL Server 的更新版本。
请联机查看有关此错误消息的详细信息。