简体   繁体   English

在SQL Server之间传输数据的最佳方法

[英]Best way to transfer data between SQL Servers

I have a general in-office database and a bunch of laptop-installed SQL Server Express databases of the same structure. 我有一个普通的办公室数据库和一堆结构相同的便携式计算机安装的SQL Server Express数据库。 In these databases I log information, which is partitioned by the id of a specific event. 在这些数据库中,我记录信息,信息由特定事件的ID划分。 The laptops are taken by employees mostly to service one event (2-3 at the most sometimes), and obviously I have an eventId column in all tables except the dictionaries in the databases (though it rarely goes above 3 on the laptop databases). 员工通常会使用笔记本电脑来处理一个事件(有时最多为2-3个事件),并且显然,除了数据库中的字典外,所有表中都有一个eventId列(尽管在笔记本电脑数据库上很少超过3)。

When the employees come back to the office, they need to backup the last event data to the office SQL Server, where eventId 's can be a hundred or a thousand, etc., this is the history of all past events. 当员工回到办公室时,他们需要将最后一个事件数据备份到办公室SQL Server,其中eventId可以是一百或一千,等等,这是所有过去事件的历史。

Another reason for my question is I would like to be able to make an eventId -based selective copy of an existing database to a different server for development purposes (from local to SQL Azure actually). 我的问题的另一个原因是,我希望能够将基于数据库的基于eventId的选择性副本复制到其他服务器上,以用于开发目的(实际上是从本地到SQL Azure)。

What is the efficient way of moving such data between servers? 在服务器之间移动此类数据的有效方法是什么? I have approximately 50-100 tables with keys and references. 我大约有50-100个带有键和引用的表。

  1. What we do at the moment - selective copying the data to a new clean database on source server (only whatever is required for copying); 我们目前所做的是-选择性地将数据复制到源服务器上的新干净数据库中(仅复制所需的任何内容); backing up this new DB; 备份这个新的数据库; restoring it on a target server; 将其还原到目标服务器上; data copy between databases using dynamic T-SQL with a dbname as a parameter. 使用带有dbname作为参数的动态T-SQL在数据库之间进行数据复制。 What I don't like is dynamic T-Sql, no syntax check at all until runtime. 我不喜欢动态T-Sql,直到运行时才进行语法检查。

  2. Loading data somewhat in RAM with help of developing a C# program (but it may be too resource consuming, as long as data may be large) and transferring it to a new server with a C# program as a proxy and RAM as intermediate storage. 借助开发C#程序将数据稍微加载到RAM中(但是,只要数据可能很大,它可能会占用大量资源),然后将数据传输到具有C#程序作为代理和RAM作为中间存储的新服务器。 Challenging and in certain situations impossible (too much data). 具有挑战性,在某些情况下是不可能的(数据太多)。

  3. I started looking into SSIS, but it seems that the general advice for use of SSIS is when copying is done at fixed environment ("in-house"). 我开始研究SSIS,但似乎使用SSIS的一般建议是在固定环境(“内部”)进行复制时。 We supply software not to a vast amount of customers, but there surely are more than one, and we would need to pass connection information dynamically from somewhere, as long as we can't visit all our customers to prepare a set-up for them on location. 我们不向大量客户提供软件,但是肯定有多个客户,并且我们需要从某个地方动态传递连接信息,只要我们不能拜访所有客户为他们准备设置在位置上。

  4. Any other suggestions? 还有其他建议吗?

Any help appreciated! 任何帮助表示赞赏!

Here is what I would recommend. 这是我的建议。

Create an SSIS package. 创建一个SSIS包。 Install it on the Laptops SQL Server Express. 将其安装在Laptops SQL Server Express上。

You can use a configuration file that will allow you to select which Event Ids you want to Export. 您可以使用配置文件,该文件将允许您选择要导出的事件ID。

You can also keep all of your connection information in the configuration file. 您还可以将所有连接信息保留在配置文件中。 For those non in-house customers you can remove the configuration file between exports. 对于那些非内部客户,您可以在导出之间删除配置文件。

That would be my recommendation. 那是我的建议。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将数据从视图传输到javascript的最佳方式 - Best way to transfer data from view to javascript 通过网络在android应用程序和WPF桌面应用程序之间传输数据的最佳方法是什么 - what is the best way to transfer data between android application and WPF desktop application over network 在两个 ASP.NET 核心 API 之间传输数据结构的最佳方式 - Best way to transfer data struct between two ASP.NET Core API's 使用C#在MS SQL Express 05中将数据从一个数据库传输到另一个数据库的最佳方法 - best way to transfer data from one database to other in ms sql express 05 using c# 在客户端和服务器之间传输日期时间的最佳方式(c#/javascript) - Best way to transfer datetimes between client and server (c# / javascript) 从一个DataBase(sql server 2008)到具有不同架构的另一个db(sql server 2008)的传输数据的最佳方式 - The Best Way For Transfer Data From One DataBase (sql server 2008) To Another db(sql server 2008) With Different Schema C#通过HTTP传输序列化Protobuff数据的最佳方法 - C# Best way to transfer Serialized Protobuff data thru http 将数据合同从服务转移到消费者的最佳方法 - Best way to transfer data contract from service to consumer 将数据从SqlDataReader传输到List的最佳方法是什么 <SomeClass> ? - What is the best way to transfer data from SqlDataReader into List<SomeClass>? 将数据从View传输到复杂控件的最佳方法 - Best way to transfer data from View to complex controls
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM