freshers/Experienced Dotnet jobs

06/07/2011

What is the advantage of SET NOCOUNT ON ?

  • Use Nocount at the begining of all your Stored procedures,Functions and Triggers
In case of regular T-sql statements(Insert,Update,Delete,Select) execution, we observe a message like some 20(rows) affected in the result window.This is actually a message database return internally to the client.This costs our application in terms of performance because information is sent back to us(client).

This intensifies when we have many operations(Insert,Update,Delete) in a stored procedure.That means each operation returns internal message within the stored procedure execution cycle.

so, we can skip this intrenal messaging operation and make our application performance faster?

YES!
            using SET NOCOUNT ON in begining of your  stored procedure.




No comments:

Post a Comment