日期:2014-05-17 浏览次数:20632 次
DELETE FROM [192.168.90.15].YY.dbo.APSCODE
CREATE TRIGGER [dbo].[TrigAPSBUFFER] ON [dbo].[APSBUFFER] AFTER INSERT AS BEGIN DELETE FROM [192.168.90.15].YY.dbo.APSCODE END
INSERT INTO dbo.APSBUFFER SELECT replace(CONVERT(varchar(100), GETDATE(), 20),'-','/')
sp_configure 'show advanced options', 1 GO RECONFIGURE GO sp_configure 'Ad Hoc Distributed Queries', 1 GO RECONFIGURE GO
------解决方案--------------------
跨数据库别用触发器,这种直接用存储过程来做,使用事务来控制。数据库都启用分布式事务处理。