所以我过去2天一直试图从我的SharePoint事件接收器执行SSIS包,几乎疯了。
SSIS包在我的开发环境中部署到Integration Service目录中(SQL Server 2014及其Integration Services安装在与SharePoint Server和我的VS2013 Community Edition相同的计算机上)。 Successfully open SSISDB Catalog from SSMS
到目前为止,这是我的代码,基本上按照此博客中的步骤进行操作 - > http://microsoft-ssis.blogspot.co.id/2013/01/call-ssis-2012-package-within-net.html
connString = @"Data Source=PIRSRV03;Initial Catalog=master;Integrated Security=SSPI;";
using (SqlConnection sqlConnection = new SqlConnection(connString))
{
IntegrationServices integrationServices = new IntegrationServices(sqlConnection);
PackageInfo myPackage = integrationServices.Catalogs[integrationServiceCatalog].Folders[integrationServiceFolder].Projects[integrationServiceProject].Packages[integrationServicePackage];
Collection<PackageInfo.ExecutionValueParameterSet> executionValueParameterSet = new Collection<PackageInfo.ExecutionValueParameterSet>();
executionValueParameterSet.Add(new
PackageInfo.ExecutionValueParameterSet { ParameterName = "ExcelFilePath", ParameterValue = TempDirectory, ObjectType = 30 });
long executionIdentifier = myPackage.Execute(false, null, executionValueParameterSet);
ExecutionOperation executionOperation = integrationServices.Catalogs["SSISDB"].Executions[executionIdentifier];
// Workaround for 30 second timeout:
// Loop while the execution is not completed
while (!(executionOperation.Completed))
{
// Refresh execution info
executionOperation.Refresh();
// Wait 5 seconds before refreshing (we don't want to stress the server)
System.Threading.Thread.Sleep(5000);
}
}
一切正常,直到它访问目录SSISDB并抛出错误的代码行, 在一点调试会话之后,通过观察Catalogs.Count属性,我发现integrationServices对象没有任何目录,在这种情况下,该属性等于零。
有没有暗示为什么会发生这种情况?
非常感谢任何帮助,谢谢!
答案 0 :(得分:2)
在我的DBA的帮助下花了几个小时试图找出问题, 事实证明,运行我的事件接收器的SharePoint Services帐户无法访问我的集成服务目录,因此目录的数量为零。
我们所做的只是为了给SharePoint Services帐户提供sysadmin权限。
希望这可以帮助某人几个小时,谢谢!