Re: Returning intermediate results from a stored procedure

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Brian (bcap_at_IHATESPAMclara.co.uk)
Date: 02/24/05


Date: Thu, 24 Feb 2005 10:36:09 -0000


"Carl Imthurn" <nospam@all.com> wrote in message
news:umE%23yifGFHA.3612@TK2MSFTNGP09.phx.gbl...
> Thanks for your reply, Tibor.
> I tried both of them in QA and for some reason they both waited 7 seconds
and then printed
> 'hello' and 'there' at the same time.
> I don't know if a configuration setting needs to be changed, but
regardless of that,
> reading the rest of your post, you lost me, technically speaking.
> (my fault, not yours, I assure you) :-)
> Anyway, thanks again for your time - I appreciate it.
>
> Carl
>
> Tibor Karaszi wrote:
>
> > Theoretically, you can add RAISERROR command in between and use the
NOWAIT option to the RAISERROR
> > command. This means that SQL Server flushes the output buffer so the
data in the buffer so far is
> > sent to the client. In order to take advantage of this in the client
applications, you need to
> > program asynchronously (obviously, otherwise the call to the db API
function is just sitting there
> > until the whole procedure has executed). Try below from QA and you'll
see the difference:
> >
> > Compare below:
> >
> > PRINT 'hello'
> > WAITFOR DELAY '00:00:7'
> > PRINT 'There'
> >
> >
> > With below:
> >
> > RAISERROR ('hello', 10, 1) WITH NOWAIT
> > WAITFOR DELAY '00:00:7'
> > PRINT 'There'
> >
> >
>

Hi Carl,

I understand your earlier reply: all your points make sense.

Tibor's suggestion is neat, I like it, I've filed it away for future use
myself. However, you do need to take careful note of his point "you need to
 program asynchronously". You haven't said what technology you are using
(ADO.Net, ADO, DAO or whatever) but it shouldn't be hard to figure out how
to run a command or query asynchronously.



Relevant Pages

  • Re: Returning intermediate results from a stored procedure
    ... "Carl Imthurn" wrote in message ... Tibor. ... you can add RAISERROR command in between and use the ... In order to take advantage of this in the client ...
    (microsoft.public.vb.general.discussion)
  • Re: [SLE] Need help with rdp on Susefirewall
    ... > Thanks Carl ... PC2 is also a client on lan1 ... You want to attach to the desktop on PC2 from PC1 ...
    (SuSE)
  • Re: 4.2 and 85010016 error
    ... Carl, added to DWORD Key AllowLSP=3. ... 0x01 for the outbound socket ... Narrowed the problem down to the ISA 2004 Firewall Client. ...
    (microsoft.public.pocketpc.activesync)
  • Re: Returning intermediate results from a stored procedure
    ... "Carl Imthurn" wrote in message ... you can add RAISERROR command in between and use the ... > NOWAIT option to the RAISERROR command. ... specifying the adAsyncExecute option for the Execute method. ...
    (microsoft.public.vb.general.discussion)
  • Re: Returning intermediate results from a stored procedure
    ... "Carl Imthurn" wrote in message ... you can add RAISERROR command in between and use the ... > NOWAIT option to the RAISERROR command. ... specifying the adAsyncExecute option for the Execute method. ...
    (microsoft.public.sqlserver.programming)