I would like to know how to call a Stored Proc with in code. Have an SQL code but need data from a table that needs to be updated by a Stored Proc. Would need to call proc in the middle of code to get the correct data. Just not sure of what the statement looks like to call the proc. Thank you for your help. David (DHL)
You say "Have an SQL code" in your post, does that mean that you have a Transact-SQL script? This is something that you'd run using either OSQL.EXE, SQLCMD.EXE, or one of the windows tools that allows you to execute SQL scripts.
If not, what language are you using? C++ is very different from VB, and neither of them is much like Perl... The way that you access the database engine is radically different in each of these languages.
Coach us a bit, and I'm sure that someone can help you!
Pat, Here is part of my code:
FROM member_table as M
LEFT JOIN Status_table as S
ON S.member_no = M.member_no
Before I can use the Status Table, a stored proc need to process to update the table. I want to start the stored proc to update the table then run the code. Is there a way to add in code to kick off the stored proc then when it's done updating the Status_Table finish to rest of my code.
Thanks for the help, David
I'm obviously not asking the correct question, so I'll try again. What language are you using to write the progam that the user will execute? Can you show me a snippet of code around where you think you want to put the SELECT statement from your last post?
Pat, Can I call (or execute) this stored prod from a view. Is there a way when you are creating the view to have the code to execute the stored prod as part of the SQL I am using for the view. Thank you David
Just an observation, but a stored procedure can be a data source, so you could create a new procedure that executed whatever procedures that you needed to execute, then performed a SELECT operation to return data to the caller of your procedure. This is logically the same as a view that executes code, it is just a different way of implementing the process.