I have a big stored procedure.
It has multiple inserts into different tables.
What I want to do is to pause stored procedure and ask user to confirm some stuff (Like do you like records that being inserted), if they click yes, I continue stored procedure and got to second table. It is Sql Server 2008 and asp.net front-end.
Thanks!
UPDATE: I need around 100 pauses. no other way than creating 100 sp?
User interaction doesn’t belong in the stored procedure (SP). It belongs in the user interface. You need to handle all of that separately – if need be, write multiple stored procedures. Your UI can then ask for input, run a procedure, get results (if needed), ask for more input (based on previous results, if needed), run another SP, etc., passing the user input into the SPs as parameters if it’s needed by the SP.
EDIT: Think of what you’re trying to do. A database server is designed to provide data, not the user interface. If you have multiple step procedures that require user input for those steps, you need to handle that in the user interface. The server can accept input through parameters that are passed from the user interface, and can provide results – that’s it. Each step of that process should be independent, and the UI should control the flow through those steps. The database has no business knowing anything about the user interface; the user interface is exactly what it’s called – the way to interact with the user.