You can put set xact_abort on
before your transaction to make sure sql rolls back automatically in case of error.
More Related Contents:
- Add a column with a default value to an existing table in SQL Server
- Simulating group_concat MySQL function in Microsoft SQL Server 2005?
- How can I do an UPDATE statement with JOIN in SQL Server?
- The multi-part identifier could not be bound
- SQL – Subtracting a depleting value from rows
- Turn off constraints temporarily (MS SQL)
- Pass table as parameter into sql server UDF
- Can a Check constraint relate to another table?
- SQL server query to get the list of columns in a table along with Data types, NOT NULL, and PRIMARY KEY constraints
- How to Replace Multiple Characters in SQL?
- EXISTS vs JOIN and use of EXISTS clause
- Is it possible to run multiple DDL statements inside a transaction (within SQL Server)?
- SQL comma-separated row with Group By clause
- How to copy a huge table data into another table in SQL Server
- How to split string using delimiter char using T-SQL?
- Should I use SQL_Variant data type?
- Performance of SQL Server 2005 Query
- OPENXML with xmlns:dt
- SQL server select distinct rows using most recent value only
- Script to save varbinary data to disk
- Measuring Query Performance : “Execution Plan Query Cost” vs “Time Taken”
- How to select date without time in SQL
- What is the internal representation of datetime in sql server?
- Eliminate and reduce overlapping date ranges
- Cumulative Total in MS Sql server [duplicate]
- SQL query to group by day
- Export table data from one SQL Server to another
- SQL can I have a “conditionally unique” constraint on a table?
- Memory effective way to read BLOB data in C#/SQL 2005
- SQL, How to Concatenate results?