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)
 How to export data to text file using ActiveX script in DTS?

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-09-06 : 07:32:23
Lynne writes "Hi,

Can someone show me how to loop through a records set, execute a select statement to export data into a text file and ftp it. I need one text file per company Id, I am doing this in DTS using ActiveX script, this is what i have so far:

Funtion Main()
Dim oRs
Dim strSQL

set ors = DTSGlobalVariables("RSTables").value

DTSGlobalVariables("strSQL").value = "SELECT * FROM " & ors.fields(4) & " WHERE companyId = " & ors.fields(0)

ors.movenext
set ors = nothing

main = DTSTaskExecResult_success
End Function

Is there a way for me to do this: as I loop through the recordset, execute the select statement to export the data to a text file and ftp the file? TIA "
   

- Advertisement -