dbTalk Databases Forums  

Beginner to vbscript question

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


Discuss Beginner to vbscript question in the microsoft.public.sqlserver.dts forum.



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

Default Beginner to vbscript question - 12-03-2004 , 09:59 AM






How would I go about telling the dts package to go to a certain step?

What I want to do is say "if condition A is true, then go to step A of the
package, otherwise go to step B"

I've got the if ... else part of it down but don't know how to say "go to
this step"

Reply With Quote
  #2  
Old   
Francesco Anti
 
Posts: n/a

Default Re: Beginner to vbscript question - 12-03-2004 , 10:49 AM






i'm not sure ti have understood yuor question. If you want to choose the DTS
step to call on the basis of an if condition, this may be a solution.
In your VBScript set a global variable value on the basis of your condition,
and then connect the TaskA and TaskB to the task with your VBscript.
Then right click TaskA/Properties/Workflow properties. Go to the options
Tab, select "Use ActiveX script" and click "properties". Finally define a
VBscript function like this
Function Main()
if DTSGlobalVariables("name").Value = .... then
Main = DTSStepScriptResult_ExecuteTask
else
Main = DTSStepScriptResult_DontExecuteTask
end if
End Function

Do the same for taskB.
Sorry for my poor english, bye
Francesco Anti

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

Quote:
How would I go about telling the dts package to go to a certain step?

What I want to do is say "if condition A is true, then go to step A of the
package, otherwise go to step B"

I've got the if ... else part of it down but don't know how to say "go to
this step"



Reply With Quote
  #3  
Old   
Darren Green
 
Posts: n/a

Default Re: Beginner to vbscript question - 12-07-2004 , 07:16 AM



In message <#aPCNgV2EHA.524 (AT) TK2MSFTNGP09 (DOT) phx.gbl>, Francesco Anti
<fanti (AT) sicosbt (DOT) it> writes
Quote:
i'm not sure ti have understood yuor question. If you want to choose the DTS
step to call on the basis of an if condition, this may be a solution.
In your VBScript set a global variable value on the basis of your condition,
and then connect the TaskA and TaskB to the task with your VBscript.
Then right click TaskA/Properties/Workflow properties. Go to the options
Tab, select "Use ActiveX script" and click "properties". Finally define a
VBscript function like this
Function Main()
if DTSGlobalVariables("name").Value = .... then
Main = DTSStepScriptResult_ExecuteTask
else
Main = DTSStepScriptResult_DontExecuteTask
end if
End Function

Do the same for taskB.
Sorry for my poor english, bye
Francesco Anti

"DBA72" <DBA72 (AT) discussions (DOT) microsoft.com> wrote in message
news:44C6767D-6C73-40C6-A9B3-8E8DBE58CFFC (AT) microsoft (DOT) com...
How would I go about telling the dts package to go to a certain step?

What I want to do is say "if condition A is true, then go to step A of the
package, otherwise go to step B"

I've got the if ... else part of it down but don't know how to say "go to
this step"


Perhaps this example will be of use to expand on Francesco's suggestion-

Skip the execution of an individual Task
(http://www.sqldts.com/default.aspx?214)

--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com

PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org



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.