Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 Runnning SSIS Package Through a Website Environmen

Author  Topic 

rcr69er
Constraint Violating Yak Guru

327 Posts

Posted - 2008-04-30 : 04:02:24
Hi

Does anyone know or could point me in the right direction to show how to run a SSIS package in a website environment?
For example clicking the button on the webpage and it executes the package.

Thanks

rgombina
Constraint Violating Yak Guru

319 Posts

Posted - 2008-04-30 : 09:32:57
Simple example -
1) Create a simple SSIS package that sends email or whatever you like (save it as indicated on ASP.NET code)
2) On your web solution "Add reference..." > ".NET" tab > Microsoft.SQLServer.ManagedDTS
3) Create Default.aspx (or whatever) with a Button (Button1) and add this stuff

using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using Microsoft.SqlServer.Dts.Runtime;

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}

protected void Button1_Click(object sender, EventArgs e)
{
Application app = new Application();
Package package = app.LoadPackage("C:\\Package.dtsx", null);
DTSExecResult result = package.Execute();
}
}

4) Email should arrive within seconds (make sure SSIS works beforehand for sure)

This could be complicated as you want but might have issues with permissions, etc but at least this is a start.

Good luck!
Go to Top of Page
   

- Advertisement -