?
Solved

Fetch with a pause

Posted on 2011-10-31
8
Medium Priority
?
356 Views
Last Modified: 2012-05-12
I have a fetch statement that on each id in the fetch it executes a stored procedure

Start Fetch...
Blah...blah...blah...
exec spMine @id
Blah...blah...blah...
next Fetch

Is there a way to put a pause (say 10 seconds) on each exec statement.
0
Comment
Question by:lrbrister
8 Comments
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 2000 total points
ID: 37058158
I have no idea what you are doing, but this should give you the pause you need:
WAITFOR DELAY '0:00:10'
0
 

Author Comment

by:lrbrister
ID: 37058228
acperkins:
In all my years I've never had a request so asinine from management

We use MS Exchange Server
I need to get "contacted by customer" emails to the Sales Reps in as fair a way as possible.
So...I have

 select salesRepEmail from repemails order by newid()  
This is done so that everyone has a chance to be first

However...
4 of the reps get their emails much slower than the other 120 reps.  as much as 10 seconds all things being equal...

So...

I've been tasked to send them out with a delay of "x" seconds in between.

Either that or I need to find a way to send the Death Star to their cubicle.
0
 
LVL 7

Expert Comment

by:skarai
ID: 37058740
I am not sure whether introducing the delay in the select statement will get you there since the problem of the delay the 4 sales reps are receiving data at wouldnt be corrected - everyone else will still get the data earlier. How about solving the delay issues for the 4 (which I assume are remote vs the others being local) 10 second delays seem excessive at this time.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:lrbrister
ID: 37059001
skarai:
Yeah...I know.  However...we have a Network team that handles the Exchange server and I can't solve this myself.

The otehrs are not remote...they're sitting in the same open office with the other 120

It's not the POP3 Send/Receive because Exchange is pushing this out automatically.

That's it...sending the Death Star.
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 37064479
>4 of the reps get their emails much slower than the other 120 reps.
the problem is surely with their email system settings config ...
which should be solved by either the exchange server or the ms outlook (presuming that client is used) team, not be sql backend.

anyhow, I don't see the point in sending 1 customer contact by email to all 124 reps ... it should be send to a couple of them, and if none of them answers/handles the request in a timely manner, send the mail to 10 more etc ... with escalation etc ...
0
 

Author Comment

by:lrbrister
ID: 37064496
angelIII:
I agree completly.
But this is a sales issue and the email contains a "Click Event"

The owner wants this to be a "eary bird..." situation.

Trying to get them to see the light.

0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 37064773
well, as said, the WAITFOR DELAY seems appropriate, but still, the 10 second delays won't really solve the issue, because those 4 will still have delays.
this said: it's those 4 that should have most interest in getting this solved, and getting it solved by the right team ...
0
 

Author Closing Comment

by:lrbrister
ID: 37064838
Thanks.
Sorry for the delay in getting back.

I hate having to do this....just for a few email accounts but it is what it is.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question