SQL.Rollback
------------

Cancels any changes made during the current transaction and ends the transaction.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [SQL](component_SQL.md) | [2.6](newinversion26.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "SQL.Rollback"; Connection ) 

**MBS**( **"SQL.Rollback";** /\* Cancels any changes made during the current transaction and ends the transaction. \*/  
**$Connection**) /\* The connection reference number gained with [SQL.NewConnection](SQLNewConnection.md). \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Connection | The connection reference number gained with [SQL.NewConnection](SQLNewConnection.md). | $Connection |

### Result

Returns "OK" or error message.

### Description

Cancels any changes made during the current transaction and ends the transaction.   
Rollback method rolls back the database to the state it was in at the completion of the last commit operation. All uncommitted work is undone.  
Rollback method rolls back the work of all commands that associated with that connection.   
To commit all changes made since the start of the transaction use [SQL.Commit](SQLCommit.md) method.  
### See also

- [SQL.Commit](SQLCommit.md)
- [SQL.NewConnection](SQLNewConnection.md)

### Example Databases

- [SQL to other databases/PostgreSQL Query](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/SQL%20to%20other%20databases/PostgreSQL%20Query.shtml#3ScriptAnchor_)

### Blog Entries

- [Transactions with SQL functions](https://www.mbsplugins.de/archive/2022-04-28/Transactions_with_SQL_function/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 1/2016, Seite 30](https://filemaker-magazin.de/neuigkeit/3870-Appetithappen-FMM_201601)

This function is free to use.

Created 18th August 2014 , last changed 18th August 2014

  
[SQL.ResetConnection](SQLResetConnection.md) - [SQL.RowsAffected](SQLRowsAffected.md)

[HTML Version](SQLRollback.shtml)