all groups > sql server dts > september 2006 >
You're in the

sql server dts

group:

parameter driven DTS


parameter driven DTS Senthilkumar
9/29/2006 10:13:51 PM
sql server dts:
Hello to all,

I am trying to learn the DTS one step at a time. I want to execute a DTS
package using .Net. I got the idea from one of the posts here with the
sub: Executing a DTS Package from VB.NET forms . It works fine when all the
rows of a table are exported.

Based on this, i used a parameter in my query like this:

select * from table1 where col1=?

and i set a globale variable for this as col1 from the parameter tab.

But where should supply the value for the parameter.

I tried this code:

package.GlobalVariables.Item("col1").Value = "xyz"

but there is no transformation taking place. The rows are always empty.

Can any one suggest the correct steps for a parametrized query driven DTS.

thanks

senthilkumar

Even in SQL enterprise manager, this doesnt work and there is no error
report. Always says, Successfully done.

Re: parameter driven DTS Senthilkumar
9/30/2006 11:06:49 PM
the actual code is given below from my form: the string "newSUID" is set as
the globalvariables in the DTS package

Dim package As DTS.Package2Class
package = New DTS.Package2Class
Dim filename As String
Dim password As String
Dim packageID As String
Dim versionID As String
Dim name As String
Dim pVarPersustStgOfHost As Object
filename = "c:\New.dts"
password = ""
packageID = ""
versionID = ""
name = "New"
' assign the global variable a value here
package.GlobalVariables.Item("newSUID").Value =
"1.3.6.1.4.1.2452.6.120050221.20844.304.1416026628"
pVarPersustStgOfHost = Nothing
package.LoadFromStorageFile(filename, _
password, packageID, versionID, _
name, pVarPersustStgOfHost)
Try
package.Execute()
Catch ex As Exception
MsgBox(ex.ToString)
Finally
package.UnInitialize()
package = Nothing
End Try


Any ideas and help pls

kesk

AddThis Social Bookmark Button