Re: Running Periodic Tasks



On 18 Jan 2006 16:10:59 GMT, someone posing as ThePsyko took a five minute
break from flipping burgers to boot up the etch-a-sketch and scribbled:


>>
>> What are your thoughts/experiences? Could DTS handle this or should I
>> be looking at an app? If I'm running an app, should it simply be a
>> scheduled task (AT/Schtasks) or run as a polling service? Also would
>> MSMQ be relevant here?
>>
>> I want a beer.
>
> Couldn't you write a .sql file to dump the data from DB1 into a flat
> file, use the DB2 utility to import, process and export the file, then
> have another .sql file reimport the data to DB1?

A .sql file? You mean one created by isqlw?

I could setup a DTS to export a query out to a flat file.

In fact, here's a current look at the query I'm messing with...

SELECT
afm.wrcf.wr_id as WorkOrder,
afm.wrcf.cf_id as UserID,
afm.wrcf.comments as Description,
(CAST(DATEPART(mm, afm.wrcf.date_assigned) AS nvarchar)
+ '/' + CAST(DATEPART(dd, afm.wrcf.date_assigned) AS nvarchar)
+ '/' + CAST(DATEPART(yyyy, afm.wrcf.date_assigned) AS nvarchar)
) as DateAssigned,
(select convert(varchar, afm.wrcf.time_assigned, 114)) as TimeAssigned,
afm.wr.ac_id as Account,
afm.bl.address1 as Building,
afm.city.name as City,
afm.city.state_id as State,
afm.bl.zip as Zip

FROM afm.wrcf, afm.wr, afm.bl, afm.city

WHERE
afm.wr.wr_id = afm.wrcf.wr_id
AND
afm.wr.bl_id = afm.bl.bl_id
AND
afm.bl.city_id = afm.city.city_id

ORDER BY
afm.wrcf.wr_id


That part is pretty much done. This is a pathetic database which is
completely un normalized. (Is that a word?)


> You'd have to know how
> long the processing by DB2 will take so you can have an idea when to
> schedule the second .sql file, but it should work.

Hmm. Interesting point. Processing generally takes less than a second.

Thanks for the tip. I'll follow up.


--
kai - theperfectreign at yahoo dot com
remember - a turn signal is a statement, not a request
.



Relevant Pages

  • Re: Importing Query From .sql file?
    ... can u tell me how to fetch query from .sql file while working in DTS 2000? ...
    (microsoft.public.sqlserver.dts)
  • Re: Importing Query From .sql file?
    ... can u tell me how to fetch query from .sql file while working in DTS 2000? ...
    (microsoft.public.sqlserver.dts)
  • Re: Running Periodic Tasks
    ... >>> I be looking at an app? ... >> then have another .sql file reimport the data to DB1? ... I'm sure there's a way to schedule it as well. ... here's a current look at the query I'm messing with... ...
    (alt.2600)
  • Re: Importing Query From .sql file?
    ... Activex task is basically to open the sql file containing query and to read ... i hv done it using "transform data task" making an ole db connection where i ...
    (microsoft.public.sqlserver.dts)
  • Re: Automating Script Execution
    ... ----Run .sql file ... > I currently have a complex .sql script that produces several result sets ... I have tried running the script through isql.exe at the comand line, ... query and not the results set itself. ...
    (microsoft.public.sqlserver.programming)