.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Post New Web Links

Sharing the variables in a master package,

Posted By:      Posted Date: October 11, 2010    Points: 0   Category :Sql Server


I have created an SSIS package that calls other packages.

This master ssis package contains a variable say MyVariable.

In the child packages I use this MyVariable in an expression to build a connection string.

@[User::MyVariable] + "Something"

This works fine, however each time I open the child packages - a couple of errors are shown in the errors pane notifying me that the variable does not exist in the child package. This is correct because it does not - however at runtime the child package can make use of the variables in the parent ssis package.

So how can i supress these errors?


I.W Coetzer

View Complete Post

More Related Resource Links

SSIS - Variables sharing from child to parent package



I'm a having a problem in passing the value of a variable from child package to the parent package in SSIS.

Can anyone please help me??? Any process would be helpful..either using configurations or using scripting (c# or vb.net)..



Sharing of Non-Static member variables of a class using .NET Remoting

This kind of weird. I am trying to host an object of a class X (a class library class). This is a SAO and I have set the WellKnownMode as Singleton in the server configuration. <wellknown mode="Singleton" When multiple clients fetch the instance of the class X they can share the static member variables. Any changes made to the static variables are visible to each other. The problem is with the non-static member variables of the class. Each instance is having a local copy of the non-static variables. Why should that happen in case of a Singleton mode? Am I missing something for which this is happening? Any help will be appreciated.  A for apple, B for boy, C for c++

Creating SSIS Package Variables Programmatically

Hi There, I am fairly new to SSIS.  I am creating a number of custom SSIS Tasks that I want to be able to share information between at runtime.  I figured that the best way to do this was through package variables, as in the Execute() method each custom task has access to the package variables through the VariableDispenser object.  I have managed to read variables at runtime that I create in the designer, however I am having trouble creating and writing to them.  I have created a very simple custom task below that I would expect to create the specified variable... [DtsTask(DisplayName = "TestVariableWriter")] public class Variab : Task { public override DTSExecResult Execute(Connections connections, VariableDispenser variableDispenser, IDTSComponentEvents componentEvents, IDTSLogging log, object transaction) { try { string varName = "TestVariable"; string varValue = "TestValue"; Variables vars = null; variableDispenser.LockForWrite(varName); variableDispenser.GetVariables(ref vars); if (variableDispenser.Contains(varName)) vars[varName].Value = varValue; else vars.Add(varName, false, string.Empty, varValue); vars.Unlock(); return DTSExecResult.Success; } catch (Exception ex) {

session variables and master pages

Hi all: I have a master page and 2 content pages. In the master page I use a session variable. As it, I suppose this session variable is read by the two content pages. But it isn't working. This session variable is read by the first content page and not the second. Why? Thanks in advance if you can help me      

Can multiple branches of a package use the same variables

Can multiple branches of a package use the same variables. I don't want to create new variables for each branch .I am getting an error in one of the script tasks  "The element cannot be found in a collection. This error happens when you try to retrieve an element from a collection on a container during execution of the package and the element is not there."  Assuming I dont have a naming error  what else should I look for.

Unable to build connection string using Package Level variables from the AcquireConnection fonction

Hi all! In SSIS 2008, within a script component trying to refer to a package level variables that was added to the ReadOnlyVariables collection of the component, the following fails within the AcquireConnnection function and I get this error: Error 1 Validation error. Test1: Test1: Microsoft.SqlServer.Dts.Pipeline.ReadOnlyVariablesNotAvailableException: The collection of variables locked for read access is not available at this point.     à Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.HandleUserException(Exception e)     à Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.AcquireConnections(Object transaction)     à Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostAcquireConnections(IDTSManagedComponentWrapper100 wrapper, Object transaction)   string connectionString = "DSN=" + this.Variables.MYDSN; Conn = new OdbcConnection(connectionString); Conn.Open();     If I move the previous code in the PreExecute function, it runs fine though.   Then, if I move the connectionString variable to the class definition, and populate it from within the PreExecute function and leave the last 2 lines in the AcquireConnection function, I get the following error: Error 1 Validation error. Test1: Test1: System.InvalidOperationException: The ConnectionString property

Sharing the session variables between two .net applications using SQL Server Mode?

Hi, I have two different IIS applications within the same domain(let us say www.mydomain.com) , both of these applications use the same database instance(same connectionstring), now what I want is that both of applications can see each sessions variables , can SQL Server session state mode helps in this case? Did someone try that before? Is there any other way to share the session variables? Please help.  

accessing package level variables in a Script Component in 2008 version


how to access the package level variables within a script component in SSIS 2008

start SSIS package via script task with package configuration via variables



it is possible to start ssis packages with dtexec and set variables as package configuration like this:

dtexec.exe /SQL "\mart1\import_fact_calls" /SERVER "R08" /SET \package.variables[FullImport].Value;True

Now I'm trying to start a package via script task with this code:

Public Sub Main()
    Dim pkg As New Package
    Dim app As New Application
    Dim pkgResults As DTSExecResult

    If Dts.Variables("package").Value <> "" Then
      pkg = app.LoadFromSqlServer(Dts.Variables("package").Value, "R08", "USER", "PASS", Nothing)
      pkgResults = pkg.Execute()
    End If

    Dts.TaskResult = ScriptResults.Success
End Sub

How can I add a package configuration like the one with dtexec to the script code?

I like any ideas, links, docus ... Thanks!

disabling concurrent excecuting of same master package!


Hello All

I have a master package that is run once every night. The package is started by another application and sometimes that application starts the master package several times. If that happens we get bad data into our datawarehouse!

So, my question is,

Is there any way to know if the master package is running?

Possible solution for me would be(I think) to create a table that logs which packages are running like:

id     name    status

1       master1    'running'

14    master4     'finished'

But, is the another more simple solution?



// David

Master Package



I'm New to SSIS & would require your help on creating a master package. Below is the query

 Query Requested

I just want to create a package that executes all of the SFDC copies, then another that executes all of the myuwdash copies   
? so we can schedule just those packages on the app server  10:31:50 AM
? we can exececute all of the DTSX packages from within a single .BAT file, but it might be cleaner to execute just one DTSX package that, in turn, executes all of you associated packages  10:33:06 AM


Accessing Package variables at design time


Hello All,

I have a question relating to the variables in SSIS.

I have an existing etl package with data flow components. One of the column is System_id to identify the Source System, the package is pulling the data from.  I plan to create a component which will validate the data based on the Rules stored in the database. These rules will be accessed based on the System_id + Target combination which needs to be set by the user at design time when the component is dropped.

In design time, i want to access this System_id field for the Custom data flow component so that i can access the database table and display the available Targets for this System_id which the user can set so that i can run the rules against this data.

I understand that i cannot access the value of the data flow at design time. My question is there other way, where i can set the variable value and access it at design time ?

Please let me know







Get list of package variables in SSIS code


Hi all,

i need to get list of package variable names during execution of a custom control flow task.

Best regards Crom

WSP Builder to package custom master pages

Hi all,

I know there are various posts on packaging up custom master pages with wspbuilder but I have a bit of a twist with my particular situation.  I'm new to this and need to go from development to staging to production with master pages, web parts, etc.

I have created a custom master page using SharePoint Designer and also needed to modify various other pages (simple.master, signout.aspx, etc) to keep the look and feel intact.  Do I simply place the modified files in the LAYOUTS folder of my solution for wspbuilder?  Please note that I will need to deploy to a farm with multiple WFEs.  Any links to articles showing how to do this is greatly appreciated.

Thanks in advance,

Dts Package Variables Works in ScriptMain but Not DtsUtility.cs


I have a few useful snipits that I had preferred to keep in a helper file named DtsUtility.cs

The identical code for the Read/Write variables was working in ScriptMain in one task, but again rather than paste that into the ScriptMain for each task I wanted to add the on cs file to each task.

The error essentially is that the variables cannot be found at line, vd.LockOneForWrite(varName, ref Vars);

ScriptMain snipit...

        using DtsUtility;
        ...........omitted code......
        if (dsX.Tables[0].Rows.Count >= 1)
        ParaID = (Guid)dsX.Tables[0].Rows[0]["ParaID"];
        CaseNo = (string)dsX.Tables[0].Rows[0]["CaseNo"];
        sXML = (string)dsX.Tables[0].Rows[0]["OrderXML"];
        DtsUtil u = new DtsUtil();
        bSucess = u.WriteDTSVar("RecID", RecID);
        bSucess = u.WriteDTSVar("ParaID", ParaID);
        bSucess = u.WriteDTSVar(&

Master-Detail with the GridView, DetailsView and jQuery's ThickBox

One more article about grids from Matt Berseth. This time he shows how to create master-detail with the gridview, detailsview and jQuery's ThickBox. He writes:
So I thought I would check some of this out and along the way rebuild my Master-Detail with the GridView, DetailView and ModalPopup Controls and replace the ModalPopup with jQuery's ThickBox. I found it pretty interesting - read on to see how it went

GridView inline Master/Detail record display

This code drop is part of a smash and grab series. If you're in a rush, you can just grab this code and insert it into your application, no understanding is required. When you have some time (ya, right) you may want to review the source code.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend