WAITFOR DELAY: How can I continue to delay and excute until process is complete?

Hello my friends:
Is it possible to run a select statement an wait, then run again until the table has no data?
The following is an example code:
BEGIN
IF (SELECT COUNT(*) FROM MySchema.MyTable) > 1
BEGIN
WAITFOR DELAY '00:00:5';
SELECT COUNT(*) FROM MySchema.MyTable;
END
END
I want to repeat the code above with the delay until the table count is zero.
Is this possible?
Thanks!

I have several options:
Because this is a SSIS Task, I can use a loop and get the data as available with a pause
I can add the wait in TSQL in a stored procedure
Maybe I can put a pause in the program itself.
I'm not sure I understand what you mean about option 3 since this is an SSIS package. These options are easily doable. I could be inclined to implement the pause in an SSIS script task containing the code below, with the package controlling the loop.
System.Threading.Thread.Sleep(10000);
Dan Guzman, SQL Server MVP, http://www.dbdelta.com
Hey Dan, with option 3: I was meaning to put a pause in the calling method which execute the stored procedure to the Dataset.
Moving on with your recommendation, there is one area which confuses me.
I found the follow article:
http://www.bidn.com/blogs/mikedavis/ssis/158/make-an-ssis-package-delay-or-wait-for-data
I need the task to execute (go to another task) if the count is not zero,  then pause.
Now do the whole thing over after a few seconds until the Count is zero.
Currently if the Count is not zero, the task execute and finishes but that's it, nothing else happens. I guess I am looking to repeat the entire process until the count is zero.
Step 1: If Count != 0 run task B
Step 2: Pause for 15 seconds
Step 3: Re-evaluate the count again if it is still not equals zero, run task B again.
Pause and reevaluate the count, if it is zero exit.

Similar Messages

  • How can we change the description and name of Process Chain in Production

    Guys,
    Can anyone please help me to understand how can we change the name and description of the process chains in Production in SAP BI?
    Regards

    open the process chain and go to edit mode and then press Ctrl+F6 for a rename... you can only rename the description and not the technical name.
    If you want to edit PC in production - esp one which has been transported - go to transport connection and change the object changeability for the same to everything changeable ( right click on the same to get this option )

  • How can I continuously auto-save and auto-name the JPEG files with a controlled time interval

    Hi,
    I am newly involved in some Labview projects that out of my knowledge. I am trying to save multiple JPEG images from a live imaging task to a folder in the computer hard disk every certain minutes. I'd like to name these files with the date and time (eg. Img_06012011_1635. jpg).Then, after hours long image capturing, I can have all the image files in a neat order.
    My goal is to have the jpg files auto saved and auto-named with the data and time at that moment. I also need to control this waiting time between each savings.
    Could you please show me some hints about this? See the vi attached, I know I need to do something on the "write path" part on the up right corner. Thanks!
    Solved!
    Go to Solution.
    Attachments:
    capture.vi ‏28 KB

    Thanks, Steve. When I built up a path with the date and time info and send them to the WriteJPEG File.vi like you mentioned, it stopped saving any files into the folder. Do you think this is the problem from my while loop?Could you show me if there is any other secret functions that restrains the file saving?
    I am planning to save the image files every 30 secs,for example, and then I can have a bunch of jpg files with their unique names after hours long image acquisition.
    I appreciate you kindly help!
    Attachments:
    capture(updated).vi ‏29 KB

  • Hey, I'm trying to install Adobe Flash on my Macbook Air. At a certain point it asks for my password but it doesn't take it. So I cannot continue installment. I have reset my password already. Still the same problem. How can I continue to install when it

    Hey, I'm trying to install Adobe Flash on my Macbook Air. At a certain point it asks for my password but it doesn't take it. So I cannot continue installment. I have reset my password already. Still the same problem. How can I continue to install when it keeps asking for a password it doesn't recognize over and over again? How many times do I have to reset it then? Advice please

    You have to provide your computer's administrator password in order to install Flash Player.

  • After a clean install, how can I continue using Time Machine?

    After a clean install, how can I continue using Time Machine?
    I booted from my recovery partition, erased my HD, installed the same OS, (Lion, 10.7.5) then restored from my TM.
    If it asks if i want to use TM, I say yes. When I chose the drive, it seems to want to start all over, instead of just picking up where I left off.
    Is there any way of picking up where I left off?

    Hi Frank,
    You are sure you looking in your Library in /Users/YOUR_USERNAME/Library and not /Library at the top level of your harddrive?
    When you open iCal what do you see?  Are the calendars the two default Home and Work ones?
    I really appreciate the responses -- especially if you are in the UK as opposed to Ontario.
    Why, do you have something against London Ontario?
    John M

  • How can I do to acquire and save date in the same time and in the same file when I run continual my VI without interrupti​on.

    I've attached a VI that I am using to acquire amplitude from Spectrum analyzerse. I tried to connect amplitude ouput to the VI Write Characters To File.vi and Write to Spreadsheet File.vi. Unfortunately when I run continual this VI without interruption, labview ask me many time to enter a new file name to save a new value.
    So, How can I do to aquire and save date in the same time and in the same file when I run continual my VI for example during 10 min.
    Thank you in advance.
    Regards,
    Attachments:
    HP8563E_Query_Amplitude.vi ‏37 KB

    Hi,
    Your VI does work perfectly. Unfortunately this not what I want to do. I've made error in my last comment. I am so sorry for this.
    So I explain to you again what I want to do exactly. I want to acquire amplitude along road by my vehicle. I want to use wheel signal coming from vehicle to measure distance along road. Then I acquire 1 amplitude each 60 inches from spectrum analyzer.
    I acquire from PC parallel port a coded wheel signal coming from vehicle (each period of the signal corresponds to 12 Inches). Figure attached shows the numeric signal coming from vehicle, and the corresponding values “120” and “88” that I can read from In Port vi.
    So I want to acquire 1 time amplitude from spectrum analyser each 5
    period of the signal that I am acquiring from parallel port.
    So fist I have to find how can I count the number of period from reading the values “120” and “88” that I am acquiring from In Port (I don’t know the way to count a number of period from reading values “120” and “88”).
    Here is a new algorithm.
    1) i=0 (counter: number of period)
    2) I read value from In Port
    3) If I acquire a period
    i= i+1 (another period)
    4) If i is multiple of 5 (If I read 5 period)
    acquire 1 time amplitude and write to the same
    file this amplitude and the corresponding distance
    Distance = 12*i). Remember each period of signal
    Corresponds to 12 Inches).i has to take these
    values: 5,10,15,20,25,35,40,45,50,55,60............
    5) Back to 2 if not stop.
    Thank you very much for helping me.
    Regards,
    Attachments:
    Acquire_Amplitude_00.vi ‏59 KB
    Figure_Algorithm.doc ‏26 KB

  • How can I continue using my CS3? I needed to install a new hard drive, & CS3 wont accept my serial # on the re-install :-/

    How can I continue using my CS3? I needed to install a new hard drive, & CS3 wont accept my serial # on the re-install :-/

    Unfortunately, only Adobe customer service can assist you with your issue. These are user forums; you are not addressing Adobe here.
    Click on the link below, and after that click on "Still need Help? Contact us."
    Then on the next page, click Chat
    There is also a phone option.
    http://helpx.adobe.com/contact.html?step=PHXS_downloading-installing-setting-up_licensing- activation

  • How can I continue the chat session please?

    Hello, I have got adobe application manager installing issue. I have been chatting online with one of the expert, but the line has been cutting off because I pressed Ctrl plus R instead of Press window plus R during the process. So the conversation is over. How can I continue it again. I could not open the chatting option now. It said: 'Please quit and restart your browser to start a new chat session.' But I did restart my browser and computer, it did not help me to continue the chat session. I did call the hotline, but no one answer it. also, I did receive the email from the expert. but I could not contact him/her back. How can I do now please?

    Qi you can contact our support team at Creative Cloud membership support and your previous case history can be reviewed.

  • Without upgrading to Lion/icloud, how can I continue to share my calendars with someone else?

    I share all of my calendars right now with someone (using mobileme) and we are not planning to update to Lion just yet.  Once mobileme ends, how can we continue to share our calendars?  Thank you.

    Welcome to the Apple community.
    How are you sharing your calendars. If you are doing this by sharing accounts, you won't be able to once your mobile me account expires. If you are using the calendar sharing feature, there is no reason you shouldn't continue to do so.
    You will need to move your calendars to your "on my mac" account before Mobile Me expires.

  • In Mail, How can I continue editing an email saved as a draft?

    In Mail, seems that once I save an email I've been working on to the Drafts folder, when I reopen it, I cannot continue editing it.
    In Mail, How can I continue editing an email saved as a draft to the drafts folder?
    Steve

    Came here to find the solution but eventually found one myself. You just simply double click on the e-mail you want to edit on the left pane, and it'll open a composing window.

  • How can I continue to use my library of appleworks 6 drawings and sketches with Mountain Lion.

    How can I continue to use my library of appleworks 6 drawings and sketches with Mountain Lion?  Wednesday Jan. 30.  by Turtlelady.

    Now with iTunes 10.4 no iphone appears on the left sidebar
    Try removing and reinstalling the AMDS...
    iTunes: How to remove and reinstall the Apple Mobile Device Service on Mac OS X

  • My itunes movie rental keeps freezing how can i continue watching it?

    my itunes movie rental is frozen and will not let me watch past a little over an hour and half. how can i continue my movie?

    Hey rossfromwarren,
    Thanks for the question. It sounds like you were experiencing an issue with an iTunes Movie Rental. Due to the time limits associated with rentals, you may wish to report a problem with your purchase if the issue was not resolved before expiration:
    Report an problem with an item you bought from the iTunes Store, App Store, Mac App Store, or iBooks Store - Apple Support
    http://support.apple.com/en-us/HT1933
    Thanks,
    Matt M.

  • Hi! How can I continue my project in iMovie 10.0.1 in another Macbook?

    Hi! How can I continue my project already started in iMovie 10.0.1, in another Macbook?

    You need to make sure first that all the media is in your library and it does not contain links to external media that will break when you move your library.  You do this by choosing selecting the library in the libraries pane and choosing File - Consolidate Library Media.
    If your library is on an external drive you can simply reconnect that drive to the other mac; otherwise you will have to copy the library package (it looks like a file with the extension .imovielibrary) to the other mac.   Launch iMovie 10.   The first time iMovie won't know where the library is so you will have to choose File - Open Library - Other and navigate to the library location. 

  • You sent me a notice letting me know that adobe forms central will not continue any more. What tool will replace it? How can I continue creating forms? Thanks for your responses.

    You sent me a notice letting me know that adobe forms central will not continue any more. What tool will replace it? How can I continue creating forms? Thanks for your responses.

    Hello Chalo,
    There are many FormsCentral alternatives. Our solution, JotForm, has the most complete Import Wizard both for your forms and for your response database.
    http://www.jotform.com/formscentral/

  • HT204370 I had purchased a movie on my ipad while on a business trip and now I'm home on my IMac and wish to watch the movie I didn't finish on my iPad.  How can I continue to watch on my IMac if I purchased and started on my iPad ?

    I had purchased a movie on my ipad while on a business trip and now I'm home on my IMac and wish to watch the movie I didn't finish on my iPad.  How can I continue to watch on my IMac if I purchased and started on my iPad ?

    Open itunes, connect ipad, click File>Devices>Transfer Purchases

Maybe you are looking for

  • Try expose svn via http, but Location directive does not work.

    Hello everyone, I used svn exposed via http in OSX 10.6 and 10.7 using collabnet. Now I take OSX server 10.8 and installed svn inside XCode. SVN is correctly installed, apache respond to default site. I copied the modules dav_svn_module and authz_svn

  • Tables in Buzzword: header appearing on all pages, text in long columns disappearing,

    Hello, I prefer to use tables within a Buzzword document rather than in a free standing table document.  My appolgies for the descriptions, I do not know the correct terminology for the document types so I am just making them up on the fly. My tables

  • Service Condition Price in PR!!!!

    Hi All, If I create a purchase requisition with item category D (services) and I use a service master with a valid price in service condition maintained via ML5L, is the price then automatically retrieved in the PR line by standard SAP?? If this is n

  • Ipod *totally* freezes while jogging

    Hey, so I am having a big problem with my iPod. Basically, I usually run with my iPod inside at the gym, and when I do so I rest the iPod on a ledge on the treadmill that I run on. However, recently I've gone out running a few times because I decided

  • Address book/exchange OWA sync - help understanding Console log

    Like so many others I am having trouble getting Address Book to sync with Exchange through the Outlook Web Access settings. The trouble is that Console Messages doesn't seem to be giving me any information that I understand. Can anyone decipher this