Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SET NOCOUNT ON (I don't mean to shout)
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Versions des environnements
SQL Server:
SQL Server 2000
Divers
Thread ID:
01075920
Message ID:
01075942
Vues:
18
Sergey,
Thanks for the reply. Is it also considdered good practice to set if back off (SET NOCOUNT OFF) before exiting my SPs?

Just so I can understand it a little better. Lets say I have a SP with 3 UPDATE statements and SET NOCOUNT is OFF. Will the server "chat" with the client after each UPDATE statement?

Einar

>Yes, it's a good idea to put SET NOCOUNT ON at the beginig of each of your stored procedure but there's no reason to use it more than once per sproc.
>
>>Sorry about the shouting in the title :)
>>
>>Is it wise to have SET NOCOUNT ON before each update in my SP. Something like this:
>>
>>
>>SET NOCOUNT ON
>>UPDATE mytable
>>SET Name = @Name1
>>WHERE Id = @Id1
>>
>>SET NOCOUNT ON
>>UPDATE mytable
>>SET Name = @Name2
>>WHERE Id = @Id2
>>
>>SET NOCOUNT ON
>>UPDATE mytable
>>SET Name = @Name3
>>WHERE Id = @Id3
>>
>>
>>According to BOL:
>>"For stored procedures that contain several statements that do not return much actual data, this can provide a significant performance boost because network traffic is greatly reduced."
>>
>>I guess SET NOCOUNT ON is new to me (just stumbeled over it), anyone care to enlighten me?
Semper ubi sub ubi.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform