dbTalk Databases Forums  

Passing parameters from Visual BASIC to a DTS package

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


Discuss Passing parameters from Visual BASIC to a DTS package in the microsoft.public.sqlserver.dts forum.



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

Default Passing parameters from Visual BASIC to a DTS package - 06-27-2005 , 04:01 PM






I've created DTS packages to copy tables from SQL Anywhere version 2.5 (AKA
Sybase) to SQL Server 2000 & am executing them from Visual BASIC .NET. I'd
like to limit the data copied by the Transform Data Task by date like this:

SELECT column1, column2
FROM tablename
WHERE (column2 >= inputdateparameter1) AND (column2 <= inputdateparameter2)

So I need to be able to pass values for inputdateparameter1 and
inputdateparameter2 from VB to the DTS package.

How can this be done?
Thanks in advance.

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

Default Re: Passing parameters from Visual BASIC to a DTS package - 06-27-2005 , 04:37 PM






If you are inside VB.Net then why not change the

SourceSQLStatement of the DataPump task


You can do this from within the package and do this

SELECT.............FROM...WHERE Column1 = ? and Column2 = ?

In the package you would map the ? to global variables.

You can pass values to the GVs from VB.Net through code in the object model
if you want.

You can of course have the package find values itself through the Dynamic
Properties task.


--



Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - You thought DTS was good. here we show you the new stuff.
www.konesans.com - Consultancy from the people who know


"Tyler" <Tyler (AT) discussions (DOT) microsoft.com> wrote

Quote:
I've created DTS packages to copy tables from SQL Anywhere version 2.5
(AKA
Sybase) to SQL Server 2000 & am executing them from Visual BASIC .NET.
I'd
like to limit the data copied by the Transform Data Task by date like
this:

SELECT column1, column2
FROM tablename
WHERE (column2 >= inputdateparameter1) AND (column2 <=
inputdateparameter2)

So I need to be able to pass values for inputdateparameter1 and
inputdateparameter2 from VB to the DTS package.

How can this be done?
Thanks in advance.



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

Default Re: Passing parameters from Visual BASIC to a DTS package - 07-06-2005 , 11:34 AM



Thanks for your reply.
Could you please elaborate a bit on exactly how to "pass values to the GVs
from VB.Net through code in the object model"?

I've created global variables in my DTS package but there doesn't seem to be
a way reference a DTS global variable or to change its value from VB.

TIA.

--
Tyler


"Allan Mitchell" wrote:

Quote:
If you are inside VB.Net then why not change the

SourceSQLStatement of the DataPump task


You can do this from within the package and do this

SELECT.............FROM...WHERE Column1 = ? and Column2 = ?

In the package you would map the ? to global variables.

You can pass values to the GVs from VB.Net through code in the object model
if you want.

You can of course have the package find values itself through the Dynamic
Properties task.


--



Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - You thought DTS was good. here we show you the new stuff.
www.konesans.com - Consultancy from the people who know


"Tyler" <Tyler (AT) discussions (DOT) microsoft.com> wrote in message
news:925F166A-4224-4483-98CA-607F975C00E4 (AT) microsoft (DOT) com...
I've created DTS packages to copy tables from SQL Anywhere version 2.5
(AKA
Sybase) to SQL Server 2000 & am executing them from Visual BASIC .NET.
I'd
like to limit the data copied by the Transform Data Task by date like
this:

SELECT column1, column2
FROM tablename
WHERE (column2 >= inputdateparameter1) AND (column2 <=
inputdateparameter2)

So I need to be able to pass values for inputdateparameter1 and
inputdateparameter2 from VB to the DTS package.

How can this be done?
Thanks in advance.




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

Default Re: Passing parameters from Visual BASIC to a DTS package - 07-06-2005 , 01:43 PM



Have a read through this

DTS Global Variables and Visual Basic .Net
(http://www.sqldts.com/default.aspx?265)

--



Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - You thought DTS was good. here we show you the new stuff.
www.konesans.com - Consultancy from the people who know


"Tyler" <tylerf(REMOVETHISPART)@bocafed.org> wrote

Quote:
Thanks for your reply.
Could you please elaborate a bit on exactly how to "pass values to the GVs
from VB.Net through code in the object model"?

I've created global variables in my DTS package but there doesn't seem to
be
a way reference a DTS global variable or to change its value from VB.

TIA.

--
Tyler


"Allan Mitchell" wrote:

If you are inside VB.Net then why not change the

SourceSQLStatement of the DataPump task


You can do this from within the package and do this

SELECT.............FROM...WHERE Column1 = ? and Column2 = ?

In the package you would map the ? to global variables.

You can pass values to the GVs from VB.Net through code in the object
model
if you want.

You can of course have the package find values itself through the Dynamic
Properties task.


--



Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - You thought DTS was good. here we show you the new
stuff.
www.konesans.com - Consultancy from the people who know


"Tyler" <Tyler (AT) discussions (DOT) microsoft.com> wrote in message
news:925F166A-4224-4483-98CA-607F975C00E4 (AT) microsoft (DOT) com...
I've created DTS packages to copy tables from SQL Anywhere version 2.5
(AKA
Sybase) to SQL Server 2000 & am executing them from Visual BASIC .NET.
I'd
like to limit the data copied by the Transform Data Task by date like
this:

SELECT column1, column2
FROM tablename
WHERE (column2 >= inputdateparameter1) AND (column2 <=
inputdateparameter2)

So I need to be able to pass values for inputdateparameter1 and
inputdateparameter2 from VB to the DTS package.

How can this be done?
Thanks in advance.






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.