如何使用脚本/代码将sql数据从一个服务器导出到另一个服务器? [英] How to export sql data from one server to another server using script/code?
问题描述
我在Server1上有一个Live数据库,经常(每天)提供数据。我需要在不同的服务器(Server2)上访问它,这需要每周使用Server1中的数据进行更新。我们怎么做?
我不知道如何开始。一些调查帮助我了解了Sql Job Agents,但我需要使用代码(最好是C#)来实现这一点,以便在目标服务器上自动进行数据更新。有人可以告诉我其他方法吗?
目前我必须手动从server1进行备份并在server2上恢复它。我们如何自动化?
I have a Live database on Server1 on which data is feeded frequently(daily). I need to access this on different sever(Server2) which needs to be updated every week with the data from Server1. How do we do this?
I have no idea of how to begin. A bit of investigation helped me know about Sql Job Agents, but i need to do this using code (preferably C#) , so that data updation occurs automatically on the destination server. Can someone please tell me other ways to do this?
Currently i have to manually take backup from server1 and restore it on server2. How can we automate this?
推荐答案
示例:
周日00:00从数据库获取备份
写一个控制台程序,将你的数据库更新到另一台服务器。
并使用windows预定任务启动程序星期日00:15;
Example:
Sunday 00:00 get an backup from database
Write an console program to update your database to another server.
And use windows scheduled task to starting program sunday 00:15;
这篇关于如何使用脚本/代码将sql数据从一个服务器导出到另一个服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!