# SQL Server Rule: SRP0005
| | |
|----|----|
| Assembly | SqlServer.Rules |
| Namespace | SqlServer.Rules.Performance |
| Class | ConsiderAddingSetNoCountOnRule |
## Rule Information
| | |
|----|----|
| Id | SRP0005 |
| Friendly Name | Noisy trigger |
| Category | Performance |
| Ignorable | true |
| Applicable Types | Dml Trigger |
| | Procedure |
## Description
SET NOCOUNT ON is recommended to be enabled in stored procedures and triggers.
## Summary
SET NOCOUNT ON is recommended to be enabled in stored procedures and triggers
### Examples
```sql
CREATE PROCEDURE [dbo].[TestTokenize]
@param1 int = 0,
@param2 int
AS
SELECT * from [LocalServer].[SalesDB].[dbo].[SomeTable]
RETURN 0
-- SRP0005
```
### Remarks
This rule scans triggers and stored procedures to ensure they SET NOCOUNT to ON at the
beginning. Use SET NOCOUNT ON at the beginning of your SQL batches, stored procedures and
triggers in production environments, as this prevents the sending of DONE_IN_PROC messages
and suppresses messages like '(1 row(s) affected)' to the client for each statement in a
stored procedure. For stored procedures that contain several statements that do not return
much actual data, setting SET NOCOUNT to ON can provide a significant performance boost,
because network traffic is greatly reduced.
<sub><sup>Generated by a tool</sup></sub>