ho un ciclo while in SQL che fare qualcosa in quantoImpossibile eseguire il backtraction. Nessuna transazione o punto di salvataggio di quel nome è stato trovato
begin tran one
do some inserts in others tables
--start loop
begin tran two
--do something
begin try
--if something fail then a trigger does rollback and this return a error (and this goes to catch), then don't i need do the rollbak in catch? this could not be dissable because this is working on production
--something finished ok
commit tran two
end try
begin catch
rollback tran two
end catch
--finished loop
commit
----------
ho ottenuto questo errore viene rilevato
transazione Uncommittable alla fine della partita . La transazione viene ripristinata.
begin tran one
begin tran two
rollback tran two
facendo questo codice ottengo questo:
non possa rotolare indietro di due. Nessuna transazione o punto di salvataggio di quel nome è stata trovata.
Voglio solo che il subquery ripristini il secondo ciclo e continui con altri record.
recensione a questa domanda: http://stackoverflow.com/questions/4614942/how-can-i-ensure-that-nested-transactions-are-committed-independent-of-each-ot Presta particolare attenzione ai link nella risposta superiore. – NotMe
In sostanza, non esistono transazioni nidificate in SQL Server. – NotMe