[SOLVED] Â Button to execute a stored procedure |
6/3/2020 9:52:43 PM |
ASPRunner.NET General questions | |
I have a stored procedure that simply merges data from 2 tables and inserts the records into a 3rd table. Is there any way to add a button that simply executes the stored procedure? I don't even need to pass any values with this SP. Something like this. |
|
![]() |
FrankR_ENTA 6/4/2020 |
Look in the DB API. One of the functions will execute any SQL statement. Your SQL statement will be an invocation of the proc. |
T
|
Tim 6/4/2020 |
https://xlinesoft.com/asprunnernet/docs/how_to_execute_stored_procedures_from_events.htm
|
![]() |
FrankR_ENTA 6/4/2020 |
https://xlinesoft.com/asprunnernet/docs/how_to_execute_stored_procedures_from_events.htm As you can see from the help file, it depends on which DB you use. If you are using MSSQL (like me) then, in the server part of the button code, you do it like this:
|
T
|
Tim 6/4/2020 |
Thanks Frank. My understanding of SQL Views in 10.4 (which is something I haven't played with yet) is that you can now use a SP instead of a table, which is great. But I was talking more about SQL statements in the events. I got tired of the SQL being in one long sting, like this:
|
![]() |
FrankR_ENTA 6/4/2020 |
Thanks Frank. My understanding of SQL Views in 10.4 (which is something I haven't played with yet) is that you can now use a SP instead of a table, which is great. But I was talking more about SQL statements in the events. I got tired of the SQL being in one long sting, like this:
|
|
Lowkeck authorDevClub member 6/4/2020 |
I have a stored procedure that simply merges data from 2 tables and inserts the records into a 3rd table. Is there any way to add a button that simply executes the stored procedure? I don't even need to pass any values with this SP. Something like this. CustomQuery("EXEC populate_schedules");
|