写触发器,用于从SQLSERVER2000到SQLSERVER 2005的插入,更新,删除数据 [英] Write Trigger For Inserting ,Upating ,Deleting Data From SQLSERVER2000 To SQLSERVER 2005

查看:229
本文介绍了写触发器,用于从SQLSERVER2000到SQLSERVER 2005的插入,更新,删除数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hii全部,

我想为SQL SERVER 2000到SQL SERVER 2005写一个触发器.

问题是客户端有两个系统,其中一个系统使用SQL2000和其他SQL 2005,但是对于同一软件,我想在一个条目上更新两个服务器.

如果条目是在sql 2000服务器中创建的,则在完全触发之前,应将其插入到SQL 2005中.

是否可以将SQL SERVRE2000的触发器写入SQL SERVER2005,如果不能,则可以解决这些问题?

Hii All,

I want to write a trigger for SQL SERVER 2000 To SQL SERVER 2005.

Problem is that Client having two system on which one system they use SQL2000 and other SQL 2005 but for same software I want to update both servers on one entry.

If the entry made in sql 2000 server then throught trigger it should be insert in to SQL 2005.

Is it possible to write trigger for SQL SERVRE2000 TO SQL SERVER2005, and if not then any solution on these problems?

推荐答案

您可以使用链接服务器从以下位置创建连接: SQL Server 2000到SQL Server2005.有关说明,请参见: http://msdn.microsoft.com/en-us/library/aa213778(v=sql.80).aspx [
You could use Linked Server to create a connection from SQL Server 2000 to the SQL Server 2005. For description see: http://msdn.microsoft.com/en-us/library/aa213778(v=sql.80).aspx[^]

Now you can use the linked server inside your trigger to make modifications to the SQL Server 2005 database. Just an opionion. Personnally I would create stored procedures on both ends to handle the logic for informing (from SQL Server 2000) and making modifications (in SQL Server 2005). Then the trigger in SQL Server 2000 would only call the local procedure.


这篇关于写触发器,用于从SQLSERVER2000到SQLSERVER 2005的插入,更新,删除数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆