Graham
Graham

Reputation: 8151

commit transaction and end transaction used together

I have come across the following T-SQL:

...
COMMIT TRANSACTION
END TRANSACTION
BEGIN TRANSACTION;
...

What is the difference between COMMIT and END transaction in this case?

Upvotes: 1

Views: 116

Answers (1)

JotaBe
JotaBe

Reputation: 39045

END TRANSACTION doesn't exists in SQL Server T-SQL.

The only transaction commands available are BEGIN TRANSACTION, with an optional name, plus COMMIT and ROLLBACK, also with optional name.

END TRANSACTION will give you a syntax error.

Upvotes: 3

Related Questions