Re: Returning intermediate results from a stored procedure
From: Brian (bcap_at_IHATESPAMclara.co.uk)
Date: 02/24/05
- Next message: Matt D: "Re: Single large join vs. multiple queries"
- Previous message: Henry: "Re: Derived table and adding another column problem"
- In reply to: Carl Imthurn: "Re: Returning intermediate results from a stored procedure"
- Next in thread: Carl Imthurn: "Re: Returning intermediate results from a stored procedure"
- Reply: Carl Imthurn: "Re: Returning intermediate results from a stored procedure"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 24 Feb 2005 19:01:57 -0000
"Carl Imthurn" <nospam@all.com> wrote in message
news:eT7oKJpGFHA.2924@TK2MSFTNGP15.phx.gbl...
> Hi guys --
>
> A couple of things:
>
> 1) In regards to Tibor's suggestion:
>
> 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:
>
> I executed those commands again in QA and this time I got the expected
results:
>
> PRINT 'hello'
> WAITFOR DELAY '00:00:7'
> PRINT 'There'
>
> the above code printed 'hello' and 'There' at the same time; after 7
seconds.
> the following code printed 'hello' immediately and 'There' after 7
seconds.
>
> RAISERROR ('hello', 10, 1) WITH NOWAIT
> WAITFOR DELAY '00:00:7'
> PRINT 'There'
>
> So, no idea what happened the first time on my end, but now I understand
what you mean.
> Sorry about the mixup on my end.
>
> 2) In regards to Brian's message:
>
> >> 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.
>
> I'm using ADO. Here's the relevant code:
>
> Dim Cmd As ADODB.Command
> Set Cmd = New ADODB.Command
> Cmd.CommandText = "si_Import_APTMST_FromAS400"
> Cmd.CommandType = adCmdStoredProc
> Cmd.ActiveConnection = pADOConnection ' already created earlier in
code
> Cmd.Execute
> Set Cmd = Nothing
>
> How do I execute this asynchronously? If you could steer me in the right
direction (a web
> page describing asynchronous execution, a newsgroup posting, etc.) I would
be in your debt.
>
> Thanks to both of you again for your time and expertise.
> PS I looked at the timestamp of your postings and thought goodness
gracious, don't these
> guys ever sleep? But from Brian's e-mail address he appears to be in the
UK, and if I
> remember correctly Tibor, you're in Sweden right now. Anyway, guys, thanks
a lot.
>
> Carl
>
Hi Carl,
I'm no ADO expert (by the time I thought about moving on from DAO, dotnet
was on it's way so there didn't seem much point in learning ADO!)
However, I understand that a command is executed asynchronously by
specifying the adAsyncExecute option for the Execute method. The command
object will raise an ExecuteComplete event when it's done.
- Next message: Matt D: "Re: Single large join vs. multiple queries"
- Previous message: Henry: "Re: Derived table and adding another column problem"
- In reply to: Carl Imthurn: "Re: Returning intermediate results from a stored procedure"
- Next in thread: Carl Imthurn: "Re: Returning intermediate results from a stored procedure"
- Reply: Carl Imthurn: "Re: Returning intermediate results from a stored procedure"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|