I am new to SSIS package and don’t have enough knowledge of the same. Below are some of my requirements:
I have a C# web application which reads data from an excel file, and we just need to give the folder path and its reads all excel files data in that folder.
Then I am putting that data in sql database.
I want to associate this C# web application code with an SSIS Package.
Can anyone give me steps how to create an SSIS package and how to associate this package with the c# code?
Yes you can do by following steps.
1. Create SSIS package - Please do search how to create SSIS package.
2. Host web application with dynamic loading package there you can update all configuration parameters dynamicaly.
3. I hope folder you mentioned in the server, if not then it has to be
go through this - Programatically load SSIS package configurations
please let me know if you need further help
Related
I have created an SSIS package in SQL Server Business Intelligence Studio on my local machine and now I want to share that package with the client.and also want to deploy that package on Server
so I am searching for the solution how to share that package with the client.
if you guys know how to share SSIS PACKAGE please provide the solution...
To deploy the package to the SQL Server, you have two options:
In Visual Studio; open the solution; right click on the project and select Deploy. Follow the steps in the wizard.
In Windows; press Windows + R to bring up the Run window; type in isdeploymentwizard.exe. Follow the steps in the wizard.
As for sharing the SSIS solution, send the client the entire folder that the solution is contained in. I avoid sharing *.dtsx files.
I have an SSIS package that simply exports a database field into a excel file. When I run it in BIDS OR SSMS it outputs perfectly however when I run it from an SQL Job it only creates an empty excel file.
If your SQL server agent get the package from Integration Service Catalog, make sure the deployed package has every task enabled, or you could enable the certain importing task and deploy again to the server. Sometimes the deployed package has disabled tasks which may not noticed by the one who deploy the package.
If you use file system, also make sure certain task has been enabled.
More important, make sure that you are using the UNC path for tasks getting access to that file.
I have an application I am writing that accepts files of various formats. Then I write code for each format (csv, excel, xml) to convert it and enter it into a SQL Server database. This is fine but I was just looking into SSIS and wondering if this would help.
The main question though is how do I run these packages within my own code? Is it easy to pass parameters? If I move this web app to another server does it depend on other components being on that server (maybe SQL Server 2012 installed)? Or is it just some DLLs I can reference from my web app?
All the demos I see are about using the SSIS tool but I am more interested in how difficult it is to call packages with parameters from my code.
The BIDS/SSDT installation includes a complete client SDK that makes it pretty simple to run SSIS packages via code.
This MSDN article explains how to load and run a package via C# in detail but the actual code boils down to:
using Microsoft.SqlServer.Dts.Runtime;
.
.
.
Application app = new Application();
Package pkg = app.LoadPackage(PKG_FILE_NAME, null);
DTSExecResult pkgResults = pkg.Execute();
The Package object has a lot of properties and methods you can look into, in particular there is a Parameters collection that allows you to pass parameters into your SSIS package before execution.
There is a very cool library called EzAPI where you can generate your own packages and call them from within C#. It gives you a lot of flexibility to generate SSIS on the fly and execute.
http://sqlsrvintegrationsrv.codeplex.com/releases/view/21238
I built a couple console apps inside this project to test some of these methods and you might find the examples useful:
https://github.com/thevinnie/SyncDatabases
Look at "BuildingAPackage" and "BuildALookupPackage"
You can programmatically build SSIS packages using C# or VB.NET and then run the packages. You can also load an existing package programmatically to execute it. I have little experience with building packages this way since most of the packages can be built easily using the following tools.
Read the article Building Packages Programmatically on MSDN for more details.
I feel that it is easier to build the packages through these IDEs depending on which version of SSIS you are targeting. You can also create initial packages through SQL Server Import and Export Wizard and save the SSIS packages to the local disk, which you can later modify according to your needs.
SSIS Version Development IDE Visual Studio Shell
------------------- ----------------------------------------------- -------------------
SSIS 2005 Business Intelligence Development Studio (BIDS) Visual Studio 2005
SSIS 2008 - 2008 R2 Business Intelligence Development Studio (BIDS) Visual Studio 2008
SSIS 2012 SQL Server Data Tools (SSDT) Visual Studio 2010
You need to reference the appropriate SSIS specific DLLs in your code to create/load SSIS packages.
However, you will need a SQL Server Integration Services license to run the package. You cannot simply reference the DLLs alone. The license is usually part of your SQL Server license, if you already have one.
Response to your comment:
We will have SQL 2012 or 2008R2 on a separate server.. So I just need to paste the needed DLLs on my web server and reference them. correct ?
The packages will execute on that server. You are just remotely invoking to execute them and you should reference the appropriate DLLs in the code within your web/other form of external application. I usually schedule the packages to run on the database servers under SQL Server Agent Job. You can try that if that is an option for you.
Package parameters are read-only from an external application. You'll need to pass them in as variables (which I have done). If you are dealing with an existing package with parameters, you may consider writing a script task that populates the parameters from the variables (which I have not done).
I have created SSIS packages. Configurations are stored within a .dtsconfig file. In order to deploy these packages to SQL Server, I am doing an Import Package (from File System) within Stored Packages.
If I make a change to the .dtsconfig file, do I need to rebuild the SSIS package and then run the Import Package again? I was wondering if there was a way to deploy an SSIS package without having to rebuild the package when a change was made to the .dtsconfig file.
The config is read at run-time. You just need to save the new .dtsConfig file and deploy it to where the package is looking for it.
I am wondering if it is possible to:
1) Develop SSIS Package for Data Flow Task
I am aware of how to do this on a local or network SQLServer,
However is it possible to create a package that uploads to a "remote" sqlserver, ie one that is not on site or on the LAN.
any guidance would be great
Thanks
Since I don't see anyway the package could see the other server, I would suggest loading the data to one or more flat files and putting them on an FTP site. Then having the remote server run an SSIS package to pick up the file(s) and process it into their system. This is basically what we do when our clients need data from us.