Execute package from SSIS catalog programmatically in SQL Server 2014 - c#

Does anybody know if Microsoft.SqlServer.Management.IntegrationServices can still be used to manage remote execution of SSIS packages in SQL Server 2014? Remotely running a project-deployed SQL 2012 SSIS Package suggests that this worked in SQL Server 2012.
MSDN page Running and Managing Packages Programmatically also lists the above mentioned namespace for working with packages (although it doesn't state if it works with remote packages).
My packages are stored in the SSISDB catalog which need to be triggered from a web application running on a different server. When I run the program in my dev environment with SSIS installed locally everything works okay but in production I am getting the following error:
Exception type: FileNotFoundException Exception message: Could not
load file or assembly
'Microsoft.SqlServer.Management.IntegrationServicesEnum,
Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or
one of its dependencies. The system cannot find the file specified.
As this dll is not referenced by my project, I am wondering if the production server requires SSIS or components of installed in order to work correctly.
I have referenced the following libraries in my project:
Microsoft.SqlServer.ConnectionInfo.dll
Microsoft.SqlServer.Management.Sdk.Sfc.dll
Microsoft.SqlServer.Smo.dll
Microsoft.SqlServer.Management.IntegrationServices.dll

I was never able to figure an answer out to my original question so I ditched the API and went with stored procedures instead, using catalog.start_execution.

Related

SSIS Deployment to Azure SQL Server, System.Net.Http.Formatting could not be found

I'm working on a project to setup a Visual Studio SSIS API package to deploy to our Azure SQL Server. It's supposed to grab data from TalentAPI and store it in our Sql Server tables through a SSIS to be executed by our SQL Server on a schedule.
This project was built with target SQL Server being 2019. Then I had to change it to SQL Server 2017 to allow it to work on Microsoft SQL Azure.
SSIS project was deployed using SSIS in SQL Server from Visual Studio 2019.
A script component source is used to make the call to TalentAPI to retrieve the data.
There is an error associated with a SSIS script component, about the System.Net.Http.Formatting could not be found when executing the package in Azure SQL Server. That so far, I've been unable to resolve.
Current Error:
Load Users data from TalentLMS to Onshore SQL DB:Error: System.IO.FileNotFoundException: Could not load file or assembly
'System.Net.Http.Formatting, Version=5.2.9.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.
The system cannot find the file specified.
File name: 'System.Net.Http.Formatting, Version=5.2.9.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.HandleUserException(Exception e)
at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.PreExecute()
at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostPreExecute(IDTSManagedComponentWrapper100 wrapper)
Specs:
Visual Studio 2019,
SSIS Project target SQL Server 2017 currently,
System.Net.Http.Formatting 5.2.9.0,
Microsoft SQL Azure (RTM) - 12.0.2000.8 Oct 18 2022 13:24:45
Since the Microsoft SQL Azure (RTM) - 12.0.2000.8 is rented on an instance, I'm unable to determine which version of .NET is needed to match up.
Any thoughts?
Tried so far:
Clearing out the NuGet cache, clean solution, restoring Nuget packages, and build.
Setting the System.Net.Http.Formatting Copy Local attribute to True to try to copy the System.Net.Http.Formatting to SQL server when deployed.

Deploying c# console application on server without actually installing oracle client

I have a c# console application which is scheduled to import bulk data from oracle to sql database. I am leaning towards using the oracle client dlls from the installation folder instead of having it installed on server. I read many existing SO answers on copying required dlls in installation folder.
https://jeremybranham.wordpress.com/2011/04/25/oracle-instant-client-with-odp-net/
The application works fine on my windows 10 machine where no oracle client is installed. But on Windows Server 2008 R2 it throws error saying OraOps12.dll is not found. Though I have the dll available. What can I do to troubleshoot the issue?
Make sure the dll is referenced in the project and it's set to copy to the output directory. I can't explain why, but I have had referenced dll's not set to copy and have run into similar issues as you are describing.
I think it is a bad idea to copy the DLL's from the Oracle Client manually. You may provide a copy of Oracle.DataAccess.dll - for all the rest ask your customer to install an appropriate Oracle Client, i.e. the version and architecture has to match the Oracle.DataAccess.dll.
Or use the ODP.NET Managed Driver (Oracle.ManagedDataAccess.dll), this is a stand-alone DLL which does not require any additional file.
Finally I could work it out without actually installing Oracle Client on the server. I was receiving error about not able to load OraOps12.dll but eventually I found out that the dll I was missing was msvcr120.dll. The dll is Microsoft Visual C++ Runtime. So now, I have following Oracle dlls in my deployment folder & the application is working. No changes in configuration are required.
msvcr120.dll
Oracle.DataAccess.dll
OraOps12.dll
oraociei12.dll
oraons.dll
oci.dll

Using SqlPackage.exe on a server without SSMS installed

I have a windows 2012 server. The server can access my SQL database.
I don't have access to the SQL database server, and I don't have access to install SSMS on the windows 2012 server running my website.
I want to use SqlPackage.exe to update my database scheme with a .dacpac file
I get the following error:
Unhandled Exception: System.TypeInitializationException: The type initializer for 'Microsoft.SqlServer.Dac.DacPackage' threw an exception. ---> System.TypeInitializationException: The type initializer for 'Microsoft.SqlServer.Dac.DacServices' threw an exception. ---> System.TypeInitializationException: The type initializer for 'SqlSchemaModelStaticState' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.SqlServer.TransactSql.ScriptDom, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.
Is there some way that I can give SqlPackage.exe the needed Microsoft.SqlServer.TransactSql.ScriptDom without installing SSMS on the server?
If it is not possible, is there then an exsisting stand-alone exe out there that can do the job?
SqlPackage come with SMSS or SQL Data Tools.
i see no other alternative than installing one of these two binaries to deploy dacpac, it is also possible from most computer running visual studio, because sql data tools is part of the defaults VS install.
https://msdn.microsoft.com/en-us/library/mt204009.aspx
You can download any of these nuget packages (depending on desired version and platform). There you will find any missing DLLs.
https://www.nuget.org/packages?q=microsoft.sqlserver.dac+microsoft.sqlserver.dacfx
(Or you could write your own C#/Powershell application, using Microsoft.SqlServer.Dac.DacServices directly from the package.)
Since Aug 2018 your best bet is to download the "Windows .NET Core .zip file" from https://learn.microsoft.com/en-us/sql/tools/sqlpackage-download?view=sql-server-2017#get-sqlpackage-net-core-for-windows
This seemed to be the "smallest" package I could install and still get the tool (sqlpackage.exe) that works.
Microsoft® SQL Server® Data-Tier Application Framework (June 30 2016)
https://www.microsoft.com/en-us/download/confirmation.aspx?id=53013
the above installed it to the below directory when I install it (today)
C:\Program Files\Microsoft SQL Server\130\DAC\bin\SqlPackage.exe
APPEND:
Mid 2020 URL Update :
Microsoft® SQL Server® Data-Tier Application Framework (18.3.1)
https://www.microsoft.com/en-us/download/details.aspx?id=100297
Usually you install SSDT to do this. I'm not sure if theres a portable version of SSDT somewhere that doesn't require an install if thats what you actually require.

Do I need TFS installed on the machine that will use some dlls to communicate remotely to it?

I guess not, but here's the catch:
I've made a COM+ Object to be used from a machine where neither VisualStudio or TFS are installed. And this COM+ Object has referenced TFS dlls to make a login on a remote TFS server and create Work Items.
And I have another additional issue. I used VS2012 and TFS2010, so the dlls referenced say 11.0.0.0 when I think they should say 10.0.0.0 or somethin of that style.
I checked on this TFS 2010 build failing because it can't load Microsoft.VisualStudio.QualityTools.Plugins.CodeCoverage version 11.0
...but I can't see if it's useful for me, and if it is, how.
This is the exact error:
Could not load file or assembly 'Microsoft.TeamFoundation.Client,
Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or
one of its dependencies. The system cannot find the file specified.
And maybe, (as I tried to say in the title), it requires to have something installed on the machine... But this machine is a server, and it bothers me a bit to install new stuff on the server.
The 11.0 DLLs are fine - it means you're using the 2012 client DLLs, but they work fine against a 2010 TFS server.
If VS is not installed on the machine where your app is running, you will need to deploy them with your app. See http://geekswithblogs.net/TarunArora/archive/2011/06/18/tfs-2010-sdk-connecting-to-tfs-2010-programmaticallyndashpart-1.aspx to know what DLLs are required and where to get them.

Deploy SMO application to workstation without SQL Server 2008 installed

I am trying to deploy an application that uses SMO on a workstation without SQL Server installed on it. The instance the app is connecting to is SQL Server 2008. The application is failing with:
Could not load file or assembly 'Microsoft.SqlServer.Replication, Version 10.0.0.0, Culture=neutral, PublicKeyToken=89845cdc8080cc91' or one of its dependencies. An attempt was made to load a program with an incorrect format.
The assembly in question is in the same path as my application as well as system32. I am running this on a Windows 7 64 bit box. I have run SQL Native Client, CLR, and SMO MSIs from the 2008 SMO redist download page.
This app worked fine when connecting to SQL Server 2005.
What gives?
It looks to me like you are referencing SMO Version 10 in you project, but the client machine you are trying to deploy your application to is probably running SMO version 9. I had this same problem and updated my project references to reference SMO verison 9. I also set the SMO objects to copy local = true to ensure the correct assembly was referenced on the client machine.

Categories

Resources