Click here to Skip to main content
Click here to Skip to main content

Developing a SSIS Package

, 2 Nov 2006
Rate this:
Please Sign up or sign in to vote.
An article on configuring an SSIS Package.

Sample Image

Introduction

This articles describes how to configure and create expressions in SQL Server 2005 Integration Services (SSIS).

Using the code

If you want to use the package which is developed in some other machine, it fails to open because of the package encryption. Normally, a package is stored in XML format and gets encrypted depending on the setting you have configured. By default, the protection level property for that package is "EncryptSensitiveWithUserKey". In this whenever the package is saved, it encrypts all sensitive information (like passwords) using machine credentials and saves it. I prefer this property value to be DontSaveSensitive, which does not save any sensitive information.

But there is a catch here. If it is not saving any information, how do we get the required information while the user tries to run the package. For that you have to create variables and create the expressions whenever needed.

Suppose you want to export data from the source (text file) to the destination (SQL Server). You need to maintain both the source path as well as the destination connection in variables. Create variables like this:

SourceConnection..."c:\source\"
DestiUserID= "sa"
DestiPassword="sa"
DestiDataBase ="TempData"
DestDataSource= "10.12.12.123"
Assign the scope of these variables as package level.

While creating the connection manager for the source and the destination instead of using a scalar connection string, use dynamic connection strings which can evaluate the expression on the fly. Set the expression for the connection string for OLEDB as:

Data Source= "+ @[User::DestDataSource] +";User ID= "+ 
             @[User::DestiUserID]   +";Password= "+ 
             @[User::DestiPassword] + 
             ";Initial Catalog= "+ @[User::DestiDataBase]  + 
             ";Provider=SQLNCLI.1;Auto Translate=False;"
Set the expression for the connection string for the source as:
@[User::SourceConnection]+"source.txt"

The expression follows the C# syntax.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

karun123
Technical Lead Thomson Reuters
India India
completed B.Tech in computer science, working as Technical Leader.

Comments and Discussions

 
GeneralProgramming SSIS Pinmemberblackpower2k71-May-09 10:00 
GeneralMy vote of 1 PinmemberPhilip F.10-Feb-09 4:16 
QuestionLooking for the Download ? PinmemberPaul Chu29-Aug-08 19:28 
Questionssis deployment PinmemberRavindra Rayudu29-Jul-08 2:17 
Question How to get execution progress ? PinmemberGil Seagal5-Sep-07 7:55 
Generalyou left out a bunch [modified] PinmemberTom McDonald20-Apr-07 11:19 
You say "use dynamic connection strings which can evaluate the expression on the fly. Set the expression for the connection string for OLEDB as", but you don't explain how to do that.
 
Despite my dts experience I am a newbie to ssis just figuring out that I had to enter the expression you gave into the 'property expressions editor' took forever (4-5 hours of blog reading and trial and error). I am posting below instructions to save you all from this fate.
 
I finally found that if I right clicked the appropriate connection in the 'connection manager' and clicked 'properties' and then found the tiny little property called 'expression' (amongst 2 dozen other properties) and put the cursor inside the value entry area which made a button with a '...' elipses appear and then clicked the stupid elipses I would get to the 'property expressions editor' where I could then click another elipses to get into the 'expressions builder' and then put in your expression and then click the 'evaluate' AND AFTER GOING THROUGH ALL THAT I FOUND YOUR EXPRESSION DOESN'T COMPILE BECAUSE YOU LEFT OFF THE LEADING QUOTATION MARK BEFORE THE WORD 'DATA SOURCE' ARGGGH.
 
You also didn't explain how to scope your variable -- in order to scope it correctly you have to click on the designer surface before adding the variable (assuming you want global scope) otherwise click on the component in designer and the scope will change to that component. MS really could have made this more intuitive--maybe a drop-down box in the scope column of the variables window...
 
TOM
 

-- modified at 6:37 Monday 23rd April, 2007
GeneralRe: you left out a bunch Pinmemberkarun12322-Apr-07 20:29 
Generalmissing microsoft.sqlserver.dts.runtime component PinmemberWenjie Wang21-Mar-07 14:32 
GeneralRe: missing microsoft.sqlserver.dts.runtime component Pinmemberkarun12321-Mar-07 20:05 
GeneralRe: missing microsoft.sqlserver.dts.runtime component PinmemberWenjie Wang22-Mar-07 17:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.141220.1 | Last Updated 2 Nov 2006
Article Copyright 2006 by karun123
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid