Problems with WHILE and PRINT

Ask a Question related to Microsoft SQL / MS SQL Server, Design and Development.

  1. #1

    Default Re: Problems with WHILE and PRINT

    Jeff,
    > I am trying to get a WHILE loop to print status messages to Query
    > Analyzer as I run the following query on SQL2K SP3:
    >
    > Additionally, if I halt execution midway, there is no output.
    > How can I actually get a message to appear to the screen every 5
    > seconds?
    Use raiserror() with the nowait option and severity 0 for
    informational message.

    declare @untilTime datetime
    declare @Now varchar(30)

    SET @untilTime = DATEADD(second, 30, getdate())
    while getdate() < @untilTime begin
    waitfor delay '00:00:05.000'
    set @Now = convert(varchar(30), getdate(), 121)
    raiserror ('%s', 0, 1, @Now) with nowait
    end

    Linda

    lindawie Guest

  2. Similar Questions and Discussions

    1. Print Problems
      Does this item from FAQ as of this morning help? Mark Hiers, "How do I add PDF printer back into printer list in OS X?" #, 10 Jul 2003 7:34 am...
    2. Acrobat Web Capture & CSS Print problems
      I had previously posted a problem with css and printing web pages in this group on 4/21. Did not get an answer, and searches of this group seemed...
    3. Print Member Problems
      I use 8.5 with PrintOMatic Lite. On my CD, the user can print members (text boxes). My client in another state says the document is totally...
    4. Print Problems FH MX MAC OSX
      Hello, testing MX (11.0.1) for the infographic-departement a newsmagazine, we found a lot of problems. So 90% of the documents can't be print out....
    5. Net:Telnet and print() problems
      thirdhorseman@3h.unity.la (Chris) writes: Use Net::Telnet::dump_log() to see what's actually being sent and received. You're not...
  3. #2

    Default Re: Problems with WHILE and PRINT


    Thanks. Works just like I need.


    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Jeff Albenberg Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139