如何使用生产数据库中的数据刷新培训数据库?
时间:2020-03-05 18:58:00 来源:igfitidea点击:
我有一个特定的网络外系统,需要维护培训安装。该系统使用SQL Server 2000作为其数据库引擎,我需要设置一个系统,以定期使用生产数据库中的数据刷新培训数据库中的数据。
我想使用SSIS,因为我们有可以运行该过程的SQL 2005服务器。我有相当多的SQL经验,但对SSIS却了解不多。我一直在尝试通过"传输数据库任务"执行此操作,但是运气不佳,因为它总是会引发错误。
如果我们忽略配置项等的使用,并且假装所有数据库名称等等都是硬编码的,那么我有以下内容:
具有以下属性的单个SSIS"传输数据库任务":
- 目标覆盖:True
- 行动:复制
- 方法:DatabaseOnline
我收到的错误是:
Error: The Execute method on the task returned error code 0x80131500 (ERROR : errorCode=-1073548784 description=Executing the query "EXEC dbo.sp_addrole @rolename = N'XXXXX' " failed with the following error: "The role 'XXXXX' already exists in the current database.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly. helpFile= helpContext=0 idofInterfaceWithError={8BDFE893-E9D8-4D23-9739-DA807BCDC2AC}). The Execute method must succeed, and indicate the result using an "out" parameter.
我确定这里发生了明显的事情,但是可以肯定的是,如果该任务设置为覆盖角色的先前存在,那不重要吗?有谁知道我需要做些什么才能使它工作?
解决方案
回答
显然,这应该在SQLServer 2005 SP2中解决。如果我们正在Visual Studio中运行SSIS包,则看起来还需要确保也修补客户端计算机。