Monday, March 12, 2012

how can I know the proces in SP is finished ?

i am using vb.net , the prgoram will called a big SP to insert the data and
the output them into a excel file.
How can I know the SP 's process is finished ?
Does SP need to return something to my vb.net ?
if yes, How can I write it ?
Please helpAgnes
> Does SP need to return something to my vb.net ?
It is up to you , to develop some logic within a stored procedure like
RAISERROR or RETURN command
What do you worry about? Does the SP hang up?
"Agnes" <agnes@.dynamictech.com.hk> wrote in message
news:%233E%23bc8hGHA.4080@.TK2MSFTNGP03.phx.gbl...
>i am using vb.net , the prgoram will called a big SP to insert the data and
>the output them into a excel file.
> How can I know the SP 's process is finished ?
> Does SP need to return something to my vb.net ?
> if yes, How can I write it ?
> Please help
>|||> How can I know the SP 's process is finished ?
The command will not return back to your program until the procedure
finishes. You may need to override the default CommandTimeout if you expect
the proc to run more than 30 seconds.

> Does SP need to return something to my vb.net ?
There is no requirement to return anything from the stored procedure. You
can trap errors via a try/catch block in your code.
Hope this helps.
Dan Guzman
SQL Server MVP
"Agnes" <agnes@.dynamictech.com.hk> wrote in message
news:%233E%23bc8hGHA.4080@.TK2MSFTNGP03.phx.gbl...
>i am using vb.net , the prgoram will called a big SP to insert the data and
>the output them into a excel file.
> How can I know the SP 's process is finished ?
> Does SP need to return something to my vb.net ?
> if yes, How can I write it ?
> Please help
>|||My program aim is [User click a button to print the account report]
(1)User click preview button ->> show one dialog progress bar form
(2)That form will create a thread ->> thread exexcute 10 sql command to
calculate the data and insert into one temp table (I will use SP to run the
insert statment)
(3) After finish, progress bar form closed, report will be preview.
Now my problem is "the report show a blank records" , It seems ,
sql command can't be completed in the thread. Or the report show before the
SP is completed. How can I know the execution in SP completed ?
"Uri Dimant" <urid@.iscar.co.il> glsD:O70EcT9hGHA.4776@.TK2MSFTNGP05.phx.gbl...[vbco
l=seagreen]
> Agnes
> It is up to you , to develop some logic within a stored procedure like
> RAISERROR or RETURN command
> What do you worry about? Does the SP hang up?
>
>
> "Agnes" <agnes@.dynamictech.com.hk> wrote in message
> news:%233E%23bc8hGHA.4080@.TK2MSFTNGP03.phx.gbl...
>[/vbcol]

No comments:

Post a Comment