7_SQL-Transactions-Injection-Server Profiler
7_SQL-Transactions-Injection-Server Profiler
2. SQL Injection
SQL TRANSACTIONS
Implicit transactions A new transaction is implicitly started when the previous transaction completes, but each transaction is
explicitly completed with a COMMIT or ROLLBACK statement.
Batch-scoped This mode is applicable only to SQL Server Multiple Active Result Sets (MARS) feature, designed to permits
transactions multiple batches to be executed using a single SQL connection.
-- Applies to SQL Server (starting with 2008) and Azure SQL Database
This command serves only in the creation of a SAVEPOINT among all the
transactional statements. The ROLLBACK command is used to undo a
group of transactions.
The syntax for rolling back to a SAVEPOINT is as shown below:
-- this will rollback to the savepoint right after the first INSERT was done
ROLLBACK TRANSACTION FirstInsert
-- this will commit the transaction leaving just the first INSERT
COMMIT
-- this will rollback to the savepoint right after the first INSERT was done
ROLLBACK TRANSACTION DataInsert
-- this will commit the transaction leaving just the first INSERT
COMMIT
PRINT @@TRANCOUNT
SQL Injection