Re: Running Periodic Tasks
- From: ThePsyko <ThePsyko@xxxxxxxxxxxxxxxxx>
- Date: 18 Jan 2006 19:33:54 GMT
On 18 Jan 2006 in alt.2600, Perfect Reign <theperfectreign@xxxxxxxxx>
made their contribution to mankind by stating in
news:5kjoeltrlq9o.nhms4fb38rt2.dlg@xxxxxxxxxx:
> 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?
..sql files.. basically a .txt file with an .sql extension that contains sql
commands :)
for example:
/**************************************/
/* TABLE STRUCTURE CHANGES */
/**************************************/
/* tblContacts */
PRINT ' Adding column PrivateStatus to tblContacts... '
if not exists (select * from syscolumns where id = object_id(N'[dbo].
[tblContacts]')
and name = 'PrivateStatus' )
BEGIN
ALTER TABLE tblContacts
ADD [PrivateStatus] [tinyint] NULL
END
ELSE
BEGIN
PRINT 'Column exists...'
END
GO
***END C&P***
that's from the last .sql file I ran. You can execute it from within SQL
Enterprise manager. I'm sure there's a way to schedule it as well. Not
sure though since I don't do much with MSSQL unless I have to.
>
> 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?)
it is now :)
>
>
>> 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.
>
>
--
ThePsyko
Public Enemy #7
http://prozac.iscool.net
.
- References:
- Running Periodic Tasks
- From: Perfect Reign
- Re: Running Periodic Tasks
- From: ThePsyko
- Re: Running Periodic Tasks
- From: Perfect Reign
- Running Periodic Tasks
- Prev by Date: Re: Anyone use Newsguy?
- Next by Date: Re: Why is it so hard to learn C or C++
- Previous by thread: Re: Running Periodic Tasks
- Next by thread: Re: Running Periodic Tasks
- Index(es):
Relevant Pages
|