views:

17

answers:

2

Hello,

I'm using a PHP database abstraction layer to work with both MySQL and SQL Server. MySQL has a 'release savepoint' statement which SQL Server does not support, and I can't find a comparable statement within T-SQL to use in its stead. Does anybody know of a way around this, or can the lack of functionality be safely ignored?

I'd appreciate any insight!

Cheers

A: 

I don't know much about MySQL but it sounds a bit like using

Save Transaction <Name> and Rollback Transaction <Name>

to partially rollback a transaction to a named point. See MSDN

SPE109
Those statements map to MySQL's SAVEPOINT <NAME> and ROLLBACK TO SAVEPOINT <NAME>; the purpose of RELEASE is to delete a savepoint without committing or rolling back at at all. From the MySQL Manual:"The RELEASE SAVEPOINT statement removes the named savepoint from the set of savepoints of the current transaction. No commit or rollback occurs. It is an error if the savepoint does not exist."I don't think those statements provide that functionality?
Craig
I understand now, I've not come across anything to clear a transaction marker. I would guess you can probably ignore them
SPE109
+1  A: 

In SQL Server you do not need to do any operation to release a savepoint. Savepoints are 'released' automatically at the final transaction commit or rollback, you don't need to manage them intermediately.

Remus Rusanu
Cool, that's what I'd hoped. Thanks!
Craig