Chủ Nhật, 6 tháng 8, 2017

What is SET NOCOUNT ON?

  • When SET NOCOUNT is ON, the count (indicating the number of rows affected by a Transact-SQL statement) is not returned. When SET NOCOUNT is OFF, the count is returned. It is used with any SELECT, INSERT, UPDATE, DELETE statement.
  • The setting of SET NOCOUNT is set at execute or run time and not at parse time.
  • SET NOCOUNT ON improves stored procedure (SP) performance.
  • Syntax: SET NOCOUNT { ON | OFF }
Example of SET NOCOUNT ON:
enter image description here
Example of SET NOCOUNT OFF:
enter image description here

Không có nhận xét nào:

Đăng nhận xét