dbTalk Databases Forums  

Disable DTS 2005 tasks dynamically at run time.

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


Discuss Disable DTS 2005 tasks dynamically at run time. in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Eric V via SQLMonster.com
 
Posts: n/a

Default Disable DTS 2005 tasks dynamically at run time. - 08-02-2005 , 02:02 PM






Hi,

I'm trying to disable DTS 2005 tasks at run time using an expression to set
the task's "Disabled" property. The expression I use is "(DT_BOOL) @[User::
DisableJobA]" where DisableJobA is a global variable set to True.

The task seems to ignore the expression at run time and never gets
disabled. If I set the task's property menually and then run it get's
disabled OK. Am I doing something wrong, is this a bug, or can you not
change that property once the package has started running?

Any other suggestion on how to disable components based on the value of a
variable?

Thanks!


--
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums...r-dts/200508/1

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

Default Re: Disable DTS 2005 tasks dynamically at run time. - 08-02-2005 , 03:20 PM






On a control flow task I added an expression of @[User::Variable] to the
Disable property of the task through the expressions interface.
@[User::Variable] is of type Boolean. It seems to work as required.





--



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


"Eric V via SQLMonster.com" <forum (AT) SQLMonster (DOT) com> wrote

Quote:
Hi,

I'm trying to disable DTS 2005 tasks at run time using an expression to
set
the task's "Disabled" property. The expression I use is "(DT_BOOL)
@[User::
DisableJobA]" where DisableJobA is a global variable set to True.

The task seems to ignore the expression at run time and never gets
disabled. If I set the task's property menually and then run it get's
disabled OK. Am I doing something wrong, is this a bug, or can you not
change that property once the package has started running?

Any other suggestion on how to disable components based on the value of
a
variable?

Thanks!


--
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums...r-dts/200508/1



Reply With Quote
  #3  
Old   
Eric V via SQLMonster.com
 
Posts: n/a

Default Re: Disable DTS 2005 tasks dynamically at run time. - 08-03-2005 , 07:50 AM



Allan Mitchell wrote:
Quote:
On a control flow task I added an expression of @[User::Variable] to the
Disable property of the task through the expressions interface.
@[User::Variable] is of type Boolean. It seems to work as required.

Hi,

[quoted text clipped - 14 lines]

Thanks!
Hi Allan,

I think if the variable is set before you start it works OK. If you try to
change the variable during processing, it seems to ignor the new value. Try
setting it to enabled, then run a script component to change the variable to
disabled. You will see the component runs anyway... Most perplexing.


--
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums...r-dts/200508/1


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

Default Re: Disable DTS 2005 tasks dynamically at run time. - 08-03-2005 , 01:23 PM



Erik

Just retested given the scenario and you are right the dataflow will not
adhere to the property setting. That said I do not think this is the right
way to go about this. Personally I would be using an expression on the
workflow to handle the execution of the next task in the workflow.





--



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


"Eric V via SQLMonster.com" <forum (AT) SQLMonster (DOT) com> wrote

Quote:
Allan Mitchell wrote:
On a control flow task I added an expression of @[User::Variable] to the
Disable property of the task through the expressions interface.
@[User::Variable] is of type Boolean. It seems to work as required.

Hi,

[quoted text clipped - 14 lines]

Thanks!

Hi Allan,

I think if the variable is set before you start it works OK. If you try to
change the variable during processing, it seems to ignor the new value.
Try
setting it to enabled, then run a script component to change the variable
to
disabled. You will see the component runs anyway... Most perplexing.


--
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums...r-dts/200508/1



Reply With Quote
  #5  
Old   
Jamie Thomson
 
Posts: n/a

Default Re: Disable DTS 2005 tasks dynamically at run time. - 08-03-2005 , 01:31 PM



Eric,
Have you considered using workflow expressions instead? IMO they're a better
option than disabling a task.

Regards
Jamie Thomson
An SSIS blog - http://blogs.conchango.com/jamiethomson/


"Eric V via SQLMonster.com" <forum (AT) SQLMonster (DOT) com> wrote

Quote:
Hi,

I'm trying to disable DTS 2005 tasks at run time using an expression to
set
the task's "Disabled" property. The expression I use is "(DT_BOOL)
@[User::
DisableJobA]" where DisableJobA is a global variable set to True.

The task seems to ignore the expression at run time and never gets
disabled. If I set the task's property menually and then run it get's
disabled OK. Am I doing something wrong, is this a bug, or can you not
change that property once the package has started running?

Any other suggestion on how to disable components based on the value of
a
variable?

Thanks!


--
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums...r-dts/200508/1



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.