开发者

SQL Server 2008: No 'release savepoint' for current transaction

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 compa开发者_如何学JAVArable 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


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.


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


The ANSI standard syntax is SAVEPOINT , ROLLBACK TO SAVEPOINT , and RELEASE SAVEPOINT . Oracle, DB/2, MySQL, Postgres, Sybase, Informix, Interbase, and Firebird all use that same, standard, syntax. SQL Server is the oddball with a different syntax and no "release".

As Remus Rusanu said, though, it's not strictly required, but could help the database manage internal resources better if it knew that the savepoint was no longer necessary (it certainly helps on multigenerational architectures like Oracle, Interbase and Firebird).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜