stored procedures with parameters inserted at different times

  • Hi

    Tried looking on the web but couldn't find a solution for whether its possible to input parameters to stored procedures at different times.

    For example, lets say that I have a table that has a column for Index and a column showing names. Now I want to change the index using a stored procedure but only want to save it once I click a save button on the application that I am developing. Is it possible to Begin Transaction in T-SQL but only Commit Transaction or Rollback Transaction based on the save input which would be provided later?

  • kubersingh711 (5/20/2011)


    Is it possible to Begin Transaction in T-SQL but only Commit Transaction or Rollback Transaction based on the save input which would be provided later?

    If I understand your question correctly you can't commit the transaction until you have the data needed to complete the transaction.

    For better, quicker answers on T-SQL questions, click on the following...
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • You wouldn't want to leave a transaction open for any length of time as that would cause blocking.

    I guess you'd have to save the various values that are set in the application and then pass them in one go to the "Save" stored procedure.

    ------------------------------------------------------------------------
    Bite-sized fiction (with added teeth) [/url]

  • True that, good point!

    Wonder why I dint think of that.

    Thanks!

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply