将包含数据的表从一台服务器上的数据库复制到另一台服务器上的数据库 [英] copy a table with data from a database on one server to a database on a second server
问题描述
大家好!
我想将一张桌子上的数据从一台服务器上的数据库复制到第二台服务器上的数据库。源表将在接下来的3分钟内使用新数据刷新。最好的方法是什么?
Hi All!
I want to copy a table with data from a database on one server to a database on a second server. The source table will refresh within next 3 min with new data. What is the best way to do this?
推荐答案
您好b $ b
第一个解决方案:
我认为你必须为执行波纹管查询定义一个作业:
Hi
First Solution:
I think you must define a job for execute bellow query:
Insert [ServerName].[DatabaseName].[SchemaName].[TableName] -- Your Destination
Select *
From [ServerName].[DatabaseName].[SchemaName].[TableName] As Sources
Where Not Exists
(Select *
From [ServerName].[DatabaseName].[SchemaName].[TableName] As Destination
Where Sources.ID = Destination.ID)
第二个解决方案:
但是如果你想要使用最好的方法,你必须使用Merge复制。
为此,您必须在SQL Server中将复制定义为合并类型。
这种方式的性能是最好的,我认为您可以信任合并复制SQL服务器。
我希望它对你有所帮助。
Second Solution:
But If you want use best way you must use from Merge Replication.
For do this you must define a replication as merge type in SQL Server.
Performance of this way is the best and I think you can trust to Merge Replication SQL Server.
I hope it's helpful for you.
您好,请看下面的链接。
http://stackoverflow.com/questions/2348863/how-to-run-a-stored-procedure-in-sql-server-every-hour [ ^ ]
http://stackoverflow.com/questions/2348863/how-to-run- a-stored-procedure-in-sql-server-every-hour [ ^ ]
http://stackoverflow.com/questions/16187222/execute -the-script-in-every-5-min-by-the-system-time [ ^ ]
希望它有所帮助!
Hi, please see the links below.
http://stackoverflow.com/questions/2348863/how-to-run-a-stored-procedure-in-sql-server-every-hour[^]
http://stackoverflow.com/questions/2348863/how-to-run-a-stored-procedure-in-sql-server-every-hour[^]
http://stackoverflow.com/questions/16187222/execute-the-script-itself-in-every-5-min-by-getting-the-system-time[^]
Hope it helps!
这篇关于将包含数据的表从一台服务器上的数据库复制到另一台服务器上的数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!