dbTalk Databases Forums  

Parameter passing for SSIS when calling from a .NET assembly

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Parameter passing for SSIS when calling from a .NET assembly in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
vnapoli
 
Posts: n/a

Default Parameter passing for SSIS when calling from a .NET assembly - 11-27-2006 , 07:40 AM






How does one supply parameters to the SSIS call when using a .NET assembly?
The code snipet I am using allows me to call a SSIS package, but I do not
know how to supply a parameter value for a SSIS package variable defined in a
package configuration with a parent package variable.

Here is the code snipet.
----------------------------------------------------

Imports Microsoft.SqlServer.Dts.Runtime

Module Module1

Sub Main()

Dim pkgLocation As String
Dim pkg As New Package
Dim app As New Application
Dim pkgResults As DTSExecResult

pkgLocation = _
"C:\Program Files\Microsoft SQL Server\90\Samples\Integration
Services\Package Samples\CalculatedColumns
Sample\CalculatedColumns\CalculatedColumns.dtsx"
pkg = app.LoadPackage(pkgLocation, Nothing)
pkgResults = pkg.Execute()

Console.WriteLine(pkgResults.ToString())
Console.ReadKey()

End Sub

End Module

-----------------------------------------------------------

Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Parameter passing for SSIS when calling from a .NET assembly - 11-27-2006 , 07:57 AM






Hello vnapoli,


Do you want to set a value of a variable in a parent package that is then
used by a child package called by the master package through a configuration?

BOL has some ideas around this for you

ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/dtsref9mref/html/M_Microsoft_SqlServer_Dts_Runtime_VariableDispense r_LockForRead_1_16219e3a.htm





Regards

Allan Mitchell
Konesans Ltd
T +44 7966 476 572
F +44 2071 008 479
http://www.konesans.com

Quote:
How does one supply parameters to the SSIS call when using a .NET
assembly?
The code snipet I am using allows me to call a SSIS package, but I do
not
know how to supply a parameter value for a SSIS package variable
defined in a
package configuration with a parent package variable.

Here is the code snipet.
----------------------------------------------------

Imports Microsoft.SqlServer.Dts.Runtime

Module Module1

Sub Main()

Dim pkgLocation As String
Dim pkg As New Package
Dim app As New Application
Dim pkgResults As DTSExecResult
pkgLocation = _
"C:\Program Files\Microsoft SQL Server\90\Samples\Integration
Services\Package Samples\CalculatedColumns
Sample\CalculatedColumns\CalculatedColumns.dtsx"
pkg = app.LoadPackage(pkgLocation, Nothing)
pkgResults = pkg.Execute()
Console.WriteLine(pkgResults.ToString())
Console.ReadKey()
End Sub

End Module

-----------------------------------------------------------




Reply With Quote
  #3  
Old   
vnapoli
 
Posts: n/a

Default Re: Parameter passing for SSIS when calling from a .NET assembly - 11-28-2006 , 12:54 PM



Allan,

We were able to find it. I was looking to pass a parameter to a standalone
SSIS package. We could eventually have one that called a child procedure,
but for now it is standalone.

Between the following statements below we added a pkg.Variables ......
statement and it worked fine. Now we have another issue with calling the
assembly from a CLR call in a stored procedure, but that will be a new post.

.....
pkg = app.LoadPackage(pkgLocation, Nothing)
pkg.Variables("ETL_PROCESS_RUN_ID").Value = 555
pkgResults = pkg.Execute()
.....




"Allan Mitchell" wrote:

Quote:
Hello vnapoli,


Do you want to set a value of a variable in a parent package that is then
used by a child package called by the master package through a configuration?

BOL has some ideas around this for you

ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/dtsref9mref/html/M_Microsoft_SqlServer_Dts_Runtime_VariableDispense r_LockForRead_1_16219e3a.htm





Regards

Allan Mitchell
Konesans Ltd
T +44 7966 476 572
F +44 2071 008 479
http://www.konesans.com

How does one supply parameters to the SSIS call when using a .NET
assembly?
The code snipet I am using allows me to call a SSIS package, but I do
not
know how to supply a parameter value for a SSIS package variable
defined in a
package configuration with a parent package variable.

Here is the code snipet.
----------------------------------------------------

Imports Microsoft.SqlServer.Dts.Runtime

Module Module1

Sub Main()

Dim pkgLocation As String
Dim pkg As New Package
Dim app As New Application
Dim pkgResults As DTSExecResult
pkgLocation = _
"C:\Program Files\Microsoft SQL Server\90\Samples\Integration
Services\Package Samples\CalculatedColumns
Sample\CalculatedColumns\CalculatedColumns.dtsx"
pkg = app.LoadPackage(pkgLocation, Nothing)
pkgResults = pkg.Execute()
Console.WriteLine(pkgResults.ToString())
Console.ReadKey()
End Sub

End Module

-----------------------------------------------------------





Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.