dbTalk Databases Forums  

parameter driven DTS

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


Discuss parameter driven DTS in the microsoft.public.sqlserver.dts forum.



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

Default parameter driven DTS - 09-29-2006 , 11:43 AM






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.



Reply With Quote
  #2  
Old   
Senthilkumar
 
Posts: n/a

Default Re: parameter driven DTS - 09-30-2006 , 12:36 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



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.