Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. SQL Server
  3. Question
SQL Server

SQL Server: SET NOCOUNT ON still returning data

Asked by Brian Kennedy Apr 24, 2021 13 views 1 answer
Share

About this question

Following the example from this page, I'm unable to stop a stored procedure from returning a select dataset.

Executing this:

SET NOCOUNT OFF; GO -- Display the count message. SELECT 'should be displayed' GO -- SET NOCOUNT to ON to no longer display the count message. SET NOCOUNT ON; GO SELECT 'should NOT be displayed' GO -- Reset SET NOCOUNT to OFF SET NOCOUNT OFF; GO Will return me this:

SET NOCOUNT ON ISSUE

Is this a bug? Is there something wrong? I'm on a SQL Server 13.0.4206 What mean sql server set nocount on?

Your answer

1 Answer

More SQL Server discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest SQL Server Blogs

Guides, tips and career advice on SQL Server from JanBask experts.