Stored Proc return value (Weird Question)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is it in any way possible to have a sProc called and executed within
SQLServer return its return value to an open .Net Vb application?

As a programmer I beleive this can be done and if I wreck my head enough I
will find a way. I have toyed with the ideas of xml, SQLServer events but
have found nothing so far.

As this is the final stage of my project I really would appreciate any input
given.

Thanks
marc.
 
marcmc said:
Is it in any way possible to have a sProc called and executed within
SQLServer return its return value to an open .Net Vb application?

As a programmer I beleive this can be done and if I wreck my head enough I
will find a way. I have toyed with the ideas of xml, SQLServer events but
have found nothing so far.

As this is the final stage of my project I really would appreciate any input
given.

Short answer: in the SqlCommand that calls the SP in question, have a
SqlParameter with its Direction set to ParameterDirection.ReturnValue -
when you execute the SqlCommand (even if you just .ExecuteNonQuery),
the Parameter's Value will be populated with the SP's return value.

If none of that made sense, ask again :)
 
Thanks Larry / Rothariger

Larry: It's a very weird one, I am not calling the sProc from the app, but
from SQLServer
However I somehow want to record the @result somewhere within the application.
I honestly don't know if it can be done.

Rothariger: What are application blocks?
 
Hi !
However I somehow want to record the @result somewhere within the application.
I honestly don't know if it can be done.

How about writing the results in a table and read them back from .NET
whenever needed ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top