Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2005 > SQL Server 2005
|
SQL Server 2005 General discussion of SQL Server *2005* version only.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 22nd, 2007, 11:39 AM
Authorized User
 
Join Date: Dec 2006
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to devendar
Default Dynamic ConnectionString in SSIS

Hi all,

   How to pass Dynamic ConnectionString Variables in SSIS Packages. I need to pass the ServerName, UserID,Password and Database Name through parameters like Global variables.

   Please help me,

Thanks in advance,
 
Old October 26th, 2007, 05:06 PM
Registered User
 
Join Date: Oct 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to omegarazor Send a message via MSN to omegarazor Send a message via Yahoo to omegarazor
Default

devendar,

You can do this by using Expressions in the Properties of the Connection Object. There are lots of parts to this but I will give you the basic gist:

 
  • Create your variables in the Variable tab, mine are ProjectServer (String), DBName (String)
  • Create your DB Connection Object connecting directly to the actual Server and Database...Test your Connection
  • Right Click on the Connection Object and Select Properties
  • In the Properties Window Select Expressions by clicking the grey box with 3 dots ...
  • Select ConnectionString from the dropdown in the 1st column, then click the grey box with 3 dots.
  • In the Expression Editor that opens enter the following: "Data Source=" + @[User::ProjectServer] + ";Initial Catalog=FinancialProcessing;Integrated Security=True;"
.

This example will use the variable I have defined for ProjectServer and incorporate it to the ConnectionString. Your ConnectionString will be more complex and use each of the variables you create. There is much more you can do with variables but
this should get you started. Good luck.






Similar Threads
Thread Thread Starter Forum Replies Last Post
ado.connectionstring ankttv Access VBA 4 November 7th, 2008 04:54 PM
Dynamic SSIS Bulk Inserk Package KingMonty SQL Server 2005 1 October 4th, 2007 09:10 AM
where to put my connectionstring pascali70 C# 10 June 22nd, 2007 05:09 AM
ConnectionString not initialized samiboy ASP.NET 2.0 Basics 2 April 30th, 2006 06:18 AM
The ConnectionString property...! rajesh0363 All Other Wrox Books 2 July 26th, 2005 01:55 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.