# SQL Server Rule: SRD0009
| | |
|----|----|
| Assembly | SqlServer.Rules |
| Namespace | SqlServer.Rules.Design |
| Class | WrapStatementsWithTransactionRule |
## Rule Information
| | |
|----|----|
| Id | SRD0009 |
| Friendly Name | Non-transactional body |
| Category | Design |
| Ignorable | false |
| Applicable Types | Procedure |
## Description
Wrap multiple action statements within a transaction.
## Summary
Wrap multiple action statements within a transaction
### Examples
```sql
CREATE PROCEDURE dbo.InsertMissingColumnSpecifiers
AS
SET NOCOUNT ON;
INSERT INTO dbo.TestTableSSDT
SELECT [IdCol],Col1,Col2,Col3,DateCol FROM dbo.TestTableSSDT;
INSERT INTO dbo.TestTableSSDT([IdCol],Col1,Col2,Col3,DateCol)
SELECT [IdCol],Col1,Col2,Col3,DateCol FROM dbo.TestTableSSDT;
-- SML012, SRD0009, SRD0013
```
### Remarks
Not wrapping multiple action statements in a transaction inside a stored procedure
can lead to malformed data if only some of the queries succeed.
<sub><sup>Generated by a tool</sup></sub>