环境之间的数据移动

环境之间的数据移动

本文介绍了SQL Server 2008中:环境之间的数据移动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个计算产品的价格的应用程序。有在数据库中的几个表中包含公式和其他逻辑来计算价格。这些计算数据是为每个产品不同。我有3个环境:制作,发布和开发。我需要一个功能,它们之间复制数据。

I have an application which calculates prices for products. There are several tables in database which contain formulas and other logic to calculate prices. These calculation data is different for each product. I have 3 environments: production, release and development. I need a functionality to copy data between them.

例如:管理员指定复制的日期和选择产品,它应该被复制。有与此相关的所有产品的价格数据被自动复制到所需​​要的环境,在特定的日期。

For example: admin specifies a date of copying and choose product which should be copied. All pricing data related to this product has to be copied to the required environment at the specific date automatically.

你能不能给我一个提醒的是执行此任务的最佳方法?它应该是基于服务器的逻辑和调度?或者,也许Sql Server的任务和链接的服务器查询?我怎么可以组织交易?等等。

Could you give me an advise what is the best approach to perform this task? Should it be server based logic and scheduler? Or maybe Sql Server job and linked server query? How do I can organize transactions? Etc..

我使用SQL Server 2008。

I use SQL Server 2008.

推荐答案

有多种方法可以做到这一点:

There are multiple ways to do this:

  1. 这是SSIS包 - 你会做一个包,可以连接到服务器并检查运行日期,然后手动将它移到

  1. An SSIS package - you would make a package that can connect to both servers and check for the run date and then manually move it over.

您可以创建一个SQL Server的工作,有一个链接的服务器查询从一台服务器来选择和插入到另一个。

You can create a sql server job, with a linked server query to select from one server and insert into another.

您甚至可以创建,这是否一个asp.net的服务(其最麻烦的)。

You can even create a asp.net service that does this (its the most cumbersome).

在任的这三种情况下,你可以申请在整个任务的事务。恕我直言,选项#2是最痛苦的...

In either of these three cases, you can apply transactions across the whole task. IMHO, option #2 is the least painful...

编辑:

所以,如果你从来没有创建SSIS包,这是一个很好的起点:

So, if you have never created and SSIS package, this is a good starting point: http://www.codeproject.com/KB/database/CreateFirstSSISPackage.aspx

这是调度作业的方式: HTTP://www.$c$cproject.com/KB/aspnet/Schedule_Run_SSIS_DTS的.aspx

This is the way to schedule the jobs:http://www.codeproject.com/KB/aspnet/Schedule_Run_SSIS_DTS.aspx

有大量的书籍可以用它,以及...

There are plenty of books available on it as well...

这篇关于SQL Server 2008中:环境之间的数据移动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 01:01