adspace


What is set nocount on and what is set nocount off?

Answer Posted / Raj Kumar Vishwakarma

SET NOCOUNT ON and SET NOCOUNT OFF are SQL Server commands used to control the number of times that an explicit message indicating the number of affected rows is displayed during a batch of statements. By default, SQL Server sends a message after every Data Manipulation Language (DML) statement indicating the number of rows affected.nnSET NOCOUNT ON prevents this behavior, while SET NOCOUNT OFF allows it.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

If any stored procedure is encrypted, then can we see its definition in activity monitor?

1073


What are the risks of storing a hibernate-managed object in a cache? How do you overcome the problems?

1200


How can I check that whether automatic statistic update is enabled or not?

1113


Why we use the openxml clause?

1080


How can you append an identity column to a temporary table?

1071


What are wait types?

1251


Is it possible to have clustered index on separate drive from original table location?

1041


This question asked during interview, 2) At the end of each month, a new table is created for each bank that contains monthly metrics consolidated at the account level. The table naming convention is bankX_YYYYMM where X represents the numeric designation of the bank and YYYYMM indicates the 4 digit year and 2 digit month. The tables contain the following fields: name data type description account text account number registered boolean indicates whether the account is registered num_trans integer number of transactions made during the time period spend numeric(9,2) total spend during the time period a) Write a SQL query that will display the total number of transactions and total spend for "Bank1" during the 4th quarter of 2009. b) Write a SQL query that will display the total number of transactions and total spend at "Bank1" and "Bank2", broken out by registered vs. non-registered accounts, during January 2010 not sure what is correct answer and how to solve?

2568


How can we solve concurrency problems?

1123


Can one drop a column from a table?

1091


What is sql server query analyzer?

1131


What are the pros and cons of putting a scalar function in a queries select list or in the where clause?

1300


Why use identity in sql server?

1203


What kind of problems occurs if we do not implement proper locking strategy?

1500


What is the primary use of the model database?

1151