SET NOCOUNT 使用说明
SET NOCOUNT
阻止在结果集中返回可显示受 Transact-SQL 语句或存储过程影响的行计数的消息。
语法
备注
示例
以下示例将禁止显示受影响的行数的消息。
USE AdventureWorks; GO SET NOCOUNT OFF; GO -- Display the count message. SELECT TOP(5)LastName FROM Person.Contact WHERE LastName LIKE 'A%'; GO -- SET NOCOUNT to ON to no longer display the count message. SET NOCOUNT ON; GO SELECT TOP(5) LastName FROM Person.Contact WHERE LastName LIKE 'A%'; GO -- Reset SET NOCOUNT to OFF SET NOCOUNT OFF; GO