What is the use of SET NOCOUNT ON/OFF statement in SQL Server?
What is the use of SET NOCOUNT ON/OFF statement in SQL Server?
31110-Nov-2021
Updated on 10-Nov-2021
Home / DeveloperSection / Forums / What is the use of SET NOCOUNT ON/OFF statement in SQL Server?
What is the use of SET NOCOUNT ON/OFF statement in SQL Server?
Steilla Mitchel
10-Nov-2021SET NOCOUNT ON/OFF in SQL Server:
SET NOCOUNT is used to count the row that are affected by using the DML statement that is select, insert, delete and update. By default the SET NOCOUNT is OFF in SQL server that are show the number of affected rows. If you don’t want to show the affected row then you can use the SET NOCOUNT ON, then the number of affected rows will not appear.
Example- Following is a SQL statement that have no use of SET NOCOUNT ON or OFF but by default SET NOCOUNT is OFF in SQL server. You can use SET NOCOUNT OFF instead of none.
Now, the following SQL statement is execute with using of SET NOCOUNT ON,