This topic illustrates how to add a "Script task" to an SSIS project in Visual Studio 2012 and deploy the SSIS Package to SQL Server 2012 and later. Older Visual Studio versions including VS 2008 and 2010 are also supported (see another topic for those versions).
Open Visual Studio 2012 and create a new "Integration Services Project." If you don't see that project templates in your VS2012, you will need to download and install "Microsoft SQL Server Data Tools - Business Intelligence for Visual Studio 2012".
Drag-and-drop a Script Task from the SSIS toolbox to the Control Flow window
gacutil –i <assemly.dll>
where <assembly.dll> is the name of the DLL you want to register (e.g., ComponentPro.Sftp.dll).Then you can start writing your script. An example of the script is as follows:
using (var client = new ComponentPro.Net.Ftp())
{
// Connect to an FTP server
client.Connect("demo.componentpro.com");
client.Login("test", "test");
// Upload a log text to the server
byte[] data = System.Text.Encoding.Default.GetBytes(logContent);
System.IO.MemoryStream ms = new System.IO.MemoryStream(data);
client.UploadFile(ms, remotePath);
}
The screenshot below shows how the code is written in Script Task:
Now switch back to the Integration Services Project and build it, you should then see:
Right-click on Integration Services Catalogs in SQL Server 2012 and choose to Create Catalog if you don't see any nodes under "Integration Services Catalogs."