Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sql-server/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql server SSIS包在Visual Studio中运行良好,但在已部署的设备上手动运行时失败_Sql Server_Sql Server 2012_Ssis_Bids - Fatal编程技术网

Sql server SSIS包在Visual Studio中运行良好,但在已部署的设备上手动运行时失败

Sql server SSIS包在Visual Studio中运行良好,但在已部署的设备上手动运行时失败,sql-server,sql-server-2012,ssis,bids,Sql Server,Sql Server 2012,Ssis,Bids,我有一个脚本任务,它将某些传入对象从一台服务器传输到另一台服务器。 这是密码 public void Main() { try { string schemaName = Dts.Variables["$Package::SchemaName"].Value.ToString(); string objectName = Dts.Variables["$Package::ObjectN

我有一个脚本任务,它将某些传入对象从一台服务器传输到另一台服务器。 这是密码

public void Main()
        {
            try
            {
            string schemaName = Dts.Variables["$Package::SchemaName"].Value.ToString();
            string objectName = Dts.Variables["$Package::ObjectName"].Value.ToString();

            //object rawETLConnection = Dts.Connections["etl"].AcquireConnection(Dts.Transaction);
            //Server etlServer = (Server)rawETLConnection;

            Server etlServer = new Server("ciesqldeva04");
            Database etlDB;
            etlDB = etlServer.Databases["sell_side_content"];




            //object rawReportingConnection = Dts.Connections["reporting"].AcquireConnection(Dts.Transaction);
            //Server reportingServer = (Server)rawReportingConnection;
            Server reportingServer = new Server("ciesqldeva05");





                Transfer xfr;
                xfr = new Transfer(etlDB);
                xfr.DestinationServer = reportingServer.Name;
                xfr.DestinationDatabase = "sell_side_content";
                xfr.DropDestinationObjectsFirst = true;
                xfr.CopyAllObjects = false;
                xfr.CopyData = true;
                xfr.CopySchema = true;
                xfr.Options.DriAll = true;


                xfr.ObjectList.Add(etlDB.Tables[objectName, schemaName]);

                xfr.TransferData();
            }
            catch (SmoException smoex)
            {
                Dts.Events.FireError(120, " SMO - TransferObjects.dtsx", smoex.Message, "", 0);

            }
            catch (Exception ex)
            {
                Dts.Events.FireError(120,"Non SMO - TransferObjects.dtsx",ex.Message,"",0);

            } 
            Dts.TaskResult = (int)ScriptResults.Success;
        }
当我通过VisualStudio2012运行它时,它工作得很好。但是,当我将其部署到box上并通过右键单击SSMS中的包名并点击execute来运行它时,它会失败,并显示以下消息 “使用SMO传输对象:错误:传输数据时出错。有关详细信息,请参阅内部异常。”

我还将脚本转换为一个控制台应用程序,并在我之前部署包的盒子上运行它,并通过终端运行它,它能够成功传输,因此看起来不像是缺少DLL的问题

这是该控制台应用程序的代码

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using Microsoft.SqlServer.Dts.Runtime;
using Microsoft.SqlServer.Management.Smo;
using System.Collections.Specialized;
using System.Collections;
namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            Server etlServer = new Server("ciesqldeva04");
            Database etlDB;
            etlDB = etlServer.Databases["sell_side_content"];




            //object rawReportingConnection = Dts.Connections["reporting"].AcquireConnection(Dts.Transaction);
            //Server reportingServer = (Server)rawReportingConnection;
            Server reportingServer = new Server("ciesqldeva05");




            try
            {
                Transfer xfr;
                xfr = new Transfer(etlDB);
                xfr.DestinationServer = reportingServer.Name;
                xfr.DestinationDatabase = "sell_side_content";
                xfr.DropDestinationObjectsFirst = true;
                xfr.CopyAllObjects = false;
                xfr.CopyData = true;
                xfr.CopySchema = true;
                xfr.Options.DriAll = true;


                xfr.ObjectList.Add(etlDB.Tables["award_sector", "people"]);

                xfr.TransferData();
            }
            catch (SmoException smoex)
            {
                Console.WriteLine("This is an SMO Exception");
                //Display the SMO exception message. 
                Console.WriteLine(smoex.Message);
                //Display the sequence of non-SMO exceptions that caused the SMO exception. 
            }
        }
    }
}
我尝试过各种各样的事情,但都没有成功。任何帮助都将不胜感激


另外,我正在SQL Server 2012上运行此功能

尝试安装64位SMO库:


如果您将日志消息更改为包含smoex.internal,它会提供有关错误的任何信息吗?在远程服务器上运行此包时,如何调用它?这是使用项目部署模型(新)还是包部署模型?我使用的是项目部署模型。我使用SSMS登录到该服务器,然后导航到IntegrationServicesCatalogs->SSIDB->下的项目来调用它。。。然后右键单击包并点击execute,同时执行内部ODE也没有帮助,因为记录的异常不是我抛出的异常。我使用这个select message_type,message from ssisdb.internal.operation_messages获取错误列表,其中operation_id=74404 order by message_time asc