比如,当前数据库名称为db1,表的名字为test1表。test1表里面有一个触发器:
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
goALTER TRIGGER [tgr_testSQL] ON [dbo].[db1]
ASBEGIN
insert into db1 (content,mobile) values('test','235435345')--我还想往隔壁的数据库db2里面的test2表里面插入数据,可否这么写:
insert into [db2].[test2] (content,mobile) values('test','235435345')
END
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
goALTER TRIGGER [tgr_testSQL] ON [dbo].[db1]
ASBEGIN
insert into db1 (content,mobile) values('test','235435345')--我还想往隔壁的数据库db2里面的test2表里面插入数据,可否这么写:
insert into [db2].[test2] (content,mobile) values('test','235435345')
END
create TRIGGER [tgr_testSQL] ON test1
after insert
asBEGIN
insert into db1.dbo.test1 (content,mobile) values('test','235435345')--我还想往隔壁的数据库db2里面的test2表里面插入数据,可否这么写:
insert into [db2].[dbo].[test2](content,mobile) values('test','235435345')
END