Hello I got some stored procedures to create products and other stuff on my site. Now I have to run some of them in a transaction. Is that possible or do I have to make a stored procedure only for the transaction?
Can I say something like
BEGIN TRAN
"1. stored procedure"
"2. stored procedure"
COMMIT
To add to the other answers above, you may want to add some error handling:
Update with C# code (I personally find it a lot easier to keep trans code out of the sprocs and in the data layer – makes composing stored procedures easier at a later stage):