dbTalk Databases Forums  

DTS LOOP Question

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


Discuss DTS LOOP Question in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Stan Sainte-Rose
 
Posts: n/a

Default DTS LOOP Question - 01-20-2004 , 11:10 AM






Hi,
I m near to end my package..

I have a problem with the Loop
I add my script at the end.
It exports the first file but ignore the others rows.
It seems after the first export process, it doesn't go back to the
oRS.MoveNext Line.

Any idea ?
Stan



Function Main()
dim pkg
dim conTextFile
set pkg = DTSGlobalVariables.Parent
Dim oRS
Set oRS = DTSGlobalVariables("Table").Value
DTSGlobalVariables("SOCID").Value = oRS.Fields(0).Value
DTSGlobalVariables("FILENAME").Value = "e:\AOV2\UPLOAD\" &
oRS.Fields(1).Value & "\PROD\client.csv"
set conTextFile = pkg.Connections("File2Export")
conTextFile.DataSource = DTSGlobalVariables("FILENAME").Value
oRS.MoveNext
Set oRS = Nothing
Main = DTSTaskExecResult_Success
End Function





Reply With Quote
  #2  
Old   
Valmir Meneses
 
Posts: n/a

Default RE: DTS LOOP Question - 01-20-2004 , 11:26 AM






Hi Stan
Try
PKG.Steps("DTSStep_DTSDataPumpTask_1").ExecutionSt atus = DTSStepExecStat_Waitin
HT


----- Stan Sainte-Rose wrote: ----

Hi
I m near to end my package.

I have a problem with the Loo
I add my script at the end
It exports the first file but ignore the others rows
It seems after the first export process, it doesn't go back to th
oRS.MoveNext Line

Any idea
Sta



Function Main(
dim pk
dim conTextFil
set pkg = DTSGlobalVariables.Paren
Dim oR
Set oRS = DTSGlobalVariables("Table").Valu
DTSGlobalVariables("SOCID").Value = oRS.Fields(0).Valu
DTSGlobalVariables("FILENAME").Value = "e:\AOV2\UPLOAD\"
oRS.Fields(1).Value & "\PROD\client.csv
set conTextFile = pkg.Connections("File2Export"
conTextFile.DataSource = DTSGlobalVariables("FILENAME").Valu
oRS.MoveNex
Set oRS = Nothin
Main = DTSTaskExecResult_Succes
End Functio






Reply With Quote
  #3  
Old   
Stan Sainte-Rose
 
Posts: n/a

Default Re: DTS LOOP Question - 01-20-2004 , 11:44 AM



Hi
Thanks Valmir I ve tried your line but it doesn't not loop. :-(
I may miss something.
Stan

Stan
"Valmir Meneses" <anonymous (AT) discussions (DOT) microsoft.com> a écrit dans le
message de news:C99FE887-9144-4DC1-AEBA-05ABA9A89B2B (AT) microsoft (DOT) com...
Quote:
Hi Stan,
Try
PKG.Steps("DTSStep_DTSDataPumpTask_1").ExecutionSt atus =
DTSStepExecStat_Waiting
HTH


----- Stan Sainte-Rose wrote: -----

Hi,
I m near to end my package..

I have a problem with the Loop
I add my script at the end.
It exports the first file but ignore the others rows.
It seems after the first export process, it doesn't go back to the
oRS.MoveNext Line.

Any idea ?
Stan



Function Main()
dim pkg
dim conTextFile
set pkg = DTSGlobalVariables.Parent
Dim oRS
Set oRS = DTSGlobalVariables("Table").Value
DTSGlobalVariables("SOCID").Value = oRS.Fields(0).Value
DTSGlobalVariables("FILENAME").Value = "e:\AOV2\UPLOAD\" &
oRS.Fields(1).Value & "\PROD\client.csv"
set conTextFile = pkg.Connections("File2Export")
conTextFile.DataSource = DTSGlobalVariables("FILENAME").Value
oRS.MoveNext
Set oRS = Nothing
Main = DTSTaskExecResult_Success
End Function








Reply With Quote
  #4  
Old   
Wayne Snyder
 
Posts: n/a

Default Re: DTS LOOP Question - 01-20-2004 , 01:26 PM



There is a looping example at www.sqldts.com



--
Wayne Snyder, MCDBA, SQL Server MVP
Computer Education Services Corporation (CESC), Charlotte, NC
www.computeredservices.com
(Please respond only to the newsgroups.)

I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org


"Stan Sainte-Rose" <stan (AT) cyber972 (DOT) com> wrote

Quote:
Hi,
I m near to end my package..

I have a problem with the Loop
I add my script at the end.
It exports the first file but ignore the others rows.
It seems after the first export process, it doesn't go back to the
oRS.MoveNext Line.

Any idea ?
Stan



Function Main()
dim pkg
dim conTextFile
set pkg = DTSGlobalVariables.Parent
Dim oRS
Set oRS = DTSGlobalVariables("Table").Value
DTSGlobalVariables("SOCID").Value = oRS.Fields(0).Value
DTSGlobalVariables("FILENAME").Value = "e:\AOV2\UPLOAD\" &
oRS.Fields(1).Value & "\PROD\client.csv"
set conTextFile = pkg.Connections("File2Export")
conTextFile.DataSource = DTSGlobalVariables("FILENAME").Value
oRS.MoveNext
Set oRS = Nothing
Main = DTSTaskExecResult_Success
End Function







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.