Re: How to do this from DTS?

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

me_at_privacy.net
Date: 05/07/04


Date: Fri, 7 May 2004 11:02:00 -0400

Allan:

How do you run a DOS command from within DTS?

SC
"Allan Mitchell" <allan@no-spam.sqldts.com> wrote in message
news:OS11msANEHA.3292@TK2MSFTNGP11.phx.gbl...
> You could maybe do this by pumping to 3 text files then using the dos COPY
> command amalgamate
>
> COPY A.txt+B.txt+C.txt D.txt
>
>
>
> --
> --
>
> Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
> www.SQLDTS.com - The site for all your DTS needs.
> I support PASS - the definitive, global community
> for SQL Server professionals - http://www.sqlpass.org
>
>
> <me@privacy.net> wrote in message
> news:eMGnN56MEHA.3972@TK2MSFTNGP10.phx.gbl...
> > I have some sql code that I'm working on that I need to create a text
file
> > as it's output. I'm creating a text file that's more or less just a
flat
> > file, that has 01, 02 and 05 level records in it.
> >
> > The 01 level is a header, with a dollar amount in a field on it.
Haven't
> > figured out how to do this one yet.
> >
> > The next records are a soldto and a shipto records. For each row on my
> > source table, I'll create 2 02 records, one with soldto info on it, one
> with
> > shipto info on it.
> >
> > Next are the 05 records, with items on it. I can create 1+ of these.
> >
> > The sql as it is now (in query analyzer) is a bunch of select &
formatting
> > statements to get the info out on the record. I have a variable where I
> set
> > the time when it loads, in order to pass the same date & time stamp to
> each
> > of the records (because the 02's are created in a different place than
the
> > 05's, they could have a different timestamp). The variable is @curtime
> and
> > it's datetime and set to getdate(). I then format it as I need to.
> >
> > The 05 records are built from a second table, where I do similar
> formatting
> > on the record, and then do an inner join on an orderid field that's in
the
> > main table.
> >
> > The fields are like this:
> >
> > date, time, orderid, reclevel.... misc data....
> >
> > So when if I need to sort it, the orderid would force the 01's, 02's and
> > 05's for customer X together, as apposed to putting customer Y's data
> > intermingled with it (the orderno has a timestamp & other info in it).
> >
> > Question is - since this is really 3+ queries, how can I do this in DTS?
> I
> > need to pass on the same date & time variable into each of the 3
selects,
> > but DTS will only process the first select statement.
> >
> > Any help appreciated.
> >
> > Thanks,
> >
> > SC
> >
> >
> >
>
>



Relevant Pages

  • Re: How to do this from DTS?
    ... How do you run a DOS command from within DTS? ... "Allan Mitchell" wrote in message ...
    (microsoft.public.sqlserver.dts)
  • Re: Date conversion errrors.
    ... > Formatting Character Data into Datetime fields ... > Allan Mitchell MCSE,MCDBA, ... > www.SQLDTS.com - The site for all your DTS needs. ... >> CREATE TABLE HuonClaim ...
    (microsoft.public.sqlserver.dts)
  • Re: Variable text file destination name
    ... Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) ... www.SQLDTS.com - The site for all your DTS needs. ... >>Allan Mitchell MCSE,MCDBA, ... >>> destination dynamically to Access or SQL databases I ...
    (microsoft.public.sqlserver.dts)
  • Re: DTS bug (?): Data Driven Query Task incorrectly replaces empty strings with NULL.
    ... DataPump task works as expected so it is not something that DTS cannot ... Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) ... >> Allan Mitchell MCSE,MCDBA, ...
    (microsoft.public.sqlserver.dts)
  • Re: crazy question....
    ... www.SQLDTS.com - The site for all your DTS needs. ... >> Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) ...
    (microsoft.public.sqlserver.dts)