Home > Archive > MS SQL Data Warehousing > April 2005 > Start DTS when max value in table has been reached









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Start DTS when max value in table has been reached
w.peereboom

2005-04-22, 9:23 am

Hello,

My problem:
Antoher server (DTS task) is updating tables in my database on my
server. After these updates i would like to start my dts. So i can be
sure to have the most updated values in my table.

For now i start my DTS at a certain time with the job manager. But
sometimes the DTS from the third party (on the other server) is taking
to much time so my dts is working with not updated values.

What i would like to do: I know that if count(*) of a certain table
gives me for example 1500 rows, my dts can start. so with some sort of
while-loop i could test if this amount has been reached en then start
the DTS.

Can anyone send me some example script/ dts / sql to perform this action
and how to loop while the amount of 1500 has not been reached

allready thanks

W. Peereboom
Jacco Schalkwijk

2005-04-23, 8:23 pm

You can put a T-SQL task as the first step in your stored procedure that
consists of the following, to check every 5 minutes if the table has already
1500 rows:

WHILE (SELECT COUNT(*) FROM some_table) < 1500
WAITFOR DELAY '00:05:00'

--
Jacco Schalkwijk
SQL Server MVP


"w.peereboom" <w. peereboom@hagazieken
huis.nl> wrote in message
news:42690940$0$142$
e4fe514c@news.xs4all.nl...
> Hello,
>
> My problem:
> Antoher server (DTS task) is updating tables in my database on my server.
> After these updates i would like to start my dts. So i can be sure to have
> the most updated values in my table.
>
> For now i start my DTS at a certain time with the job manager. But
> sometimes the DTS from the third party (on the other server) is taking to
> much time so my dts is working with not updated values.
>
> What i would like to do: I know that if count(*) of a certain table gives
> me for example 1500 rows, my dts can start. so with some sort of
> while-loop i could test if this amount has been reached en then start the
> DTS.
>
> Can anyone send me some example script/ dts / sql to perform this action
> and how to loop while the amount of 1500 has not been reached
>
> allready thanks
>
> W. Peereboom



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com