Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 is it possible use (if else) inside DTS?

Author  Topic 

hong_ma
Starting Member

37 Posts

Posted - 2006-02-03 : 16:14:32
I have a DTS package which execute a query. looks like, SELECT frequency, startdate FROM report.
then, frequency has been assigned to a global varable(F1), after that, I want to call serveral DTS packages, it depends on the global varable, like that,
if F1 = 1 execute DTS package 1
else if F1 = 2 execute DTS package2
else if F1 = 3 execute DTS package3.

I don't know where I can use this. shall I use this inside DTS or somewhere else? or it is not possible

nr
SQLTeam MVY

12543 Posts

Posted - 2006-02-03 : 18:24:10
see
http://www.sqldts.com/default.aspx?214

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

hong_ma
Starting Member

37 Posts

Posted - 2006-02-03 : 23:18:47
Thanks, but I couldn't access that link.
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2006-02-03 : 23:56:36
Looks like the site is down at the moment - try again later.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

hong_ma
Starting Member

37 Posts

Posted - 2006-02-06 : 16:20:21
Thanks, after learning, I got that
in the main execute SQL task. I used the workflow activeX script Properties which is


Function Main()
IF DTSGlobalVariables("Frequency").Value = 1 then
Main = DTS_package_1
end if
IF DTSGlobalVariables("Frequency").Value = 2 then
Main = DTS_package_2
end if
IF DTSGlobalVariables("Frequency").Value = 3 then
Main = DTS_package_3
end if
IF DTSGlobalVariables("Frequency").Value = 4 then
Main = DTS_package_4
end if
End Function


is that right?
Go to Top of Page
   

- Advertisement -