如何将记录从一个数据库表插入到SQL Server中的另一个数据库表(两个服务器都已发布)? [英] How to insert record(s) from one databases table to another database table in SQL server (both server are published)?

查看:326
本文介绍了如何将记录从一个数据库表插入到SQL Server中的另一个数据库表(两个服务器都已发布)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





i有两个已发布的sql server数据库。



如果一个记录插入一个数据库表(使用c#),它也应该插入另一个数据库表(SQL,没有c#代码)。



是否可能。



请帮帮我们。



谢谢



我的尝试:



i认为我们可以使用批量复制,但我不确定。



请给我程序。

解决方案

如果您有更新的SQL Server版本,可以使用更改跟踪,请参阅:

表上的SQL Server更改跟踪(无触发器) [ ^ ]



较旧的技术是SQL依赖项,请参阅文章:

使用C#.NET和SQL Server 2012 SQL依赖关系 [ ^ ]

Hi,

i have two published sql server database.

if a record inserted in one table of a database(using c#), it should also insert into another database table(SQL, without c# code).

is this possible or not.

Please help me guys.

Thanks

What I have tried:

i think using bulk copy we can do, but i'm not sure.

Please let me the procedure.

解决方案

If you have a newer SQL Server version you can use "Change tracking", see:
SQL Server Change Tracking on Table (Without Triggers)[^]

An older technique is SQL Dependency, see the article:
SQL Dependency with C#.NET and SQL Server 2012[^]


这篇关于如何将记录从一个数据库表插入到SQL Server中的另一个数据库表(两个服务器都已发布)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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