Re: Exporting a variable number of files from DTS...

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I would use a vbscript that calls a stored proc then loops through the recordset and creates text files with the File System Object and writes the data to them. Just keep checking the server/date and when it changes start writing to a new file. See the post from yesterday "Import text file to multiple tables" for a bunch a examples. You are doing something like the reverse of what he is doing. If you have any coworkers that do VB or VBA this would be fairly easy and not even need to run in a DTS package if you choose just to execute a vbscript instead. If you want it in a DTS then put the code in an activeX script task.

The benefit of using vbscript is that you have total control of what is happening and whether you are working in sql server, Excel, VB, active server pages, etc., the vb syntac is pretty much the same.

Walter
<rlrcstr@xxxxxxxxxxxxxxxxx> wrote in message news:eKrP%23GhbGHA.1260@xxxxxxxxxxxxxxxxxxxxxxx
I want a DTS packag ethat will query a table and, based on a couple of conditions, create several text files.

For instance, let's say that the fields in the table are Date, Server Name and User. I want to create a separate text file for each server/date combination that lists all the users for that server/date combination. There's no fixed number of servers or dates, so the number of files generated might be different every time.

How does one go about doing this with DTS on SQL Server 2000? Thanks.

Jerry

Relevant Pages

  • Re: SSIS and unicode data types
    ... my varchar columns are at most 50 characters. ... destination column in the SQL database destination is only varcharor ... How do I get an Excel column of datatype ... It left SQL Server as a VARCHAR and went into Excel, ...
    (microsoft.public.sqlserver.dts)
  • Use Single Sign on to connect to sql server
    ... connection in an excel file that connects using an odc file connecting using ... The logon account information that you configure here must match the logon ... Name: SQL Server ... If I'm connecting using a sql username, do i need to use the domain piece ...
    (microsoft.public.sharepoint.portalserver.development)
  • Re: Excel 2007 connection
    ... The Feature pack also contains the SQL Server Client ... You should install it. ... so I installed them both as I do for Excel 2003. ...
    (microsoft.public.sqlserver.olap)
  • Re: Trasfer data to SQL Server
    ... Do you know how you would execute the DTS package from excel? ... Currently Using SQL Server 2000, ... This will place a SQL Server icon onto the DTS ...
    (microsoft.public.excel.programming)
  • Re: Newbie: Update From Excel
    ... Add an Excel Connection. ... Point it to your SQL Server ... Now create a transform data task coming from the Excel Spreadsheet to the ...
    (microsoft.public.sqlserver.dts)