kwilliams
04-06-2006, 04:06 PM
I'm a complete newbie to SQL Server stored procedures (SP), and I have a simple question about SET NOCOUNT. I want to add SET NOCOUNT ON to each SP to speed up the performance a bit, but I'm not sure where to place it. Is there any uniform place to put it within a stored procedure, because I've seen it placed at the beginning, middle, and end of a SP statement. I'm figuring from that that it doesn't matter where it's placed, but I wanted to make sure. This is how I have it placed currently:
CREATE PROCEDURE [dbo].[spTitle]
@ID int,
@Col1 varchar (30),
@Col2 varchar (30),
@Col3 varchar (30),
AS
SET NOCOUNT ON
UPDATE tblTitle
SET
Col1 = @Col1,
Col2 = @Col2,
Col3 = @Col3,
WHERE ID = @ID
GO
Thanks for any help.
CREATE PROCEDURE [dbo].[spTitle]
@ID int,
@Col1 varchar (30),
@Col2 varchar (30),
@Col3 varchar (30),
AS
SET NOCOUNT ON
UPDATE tblTitle
SET
Col1 = @Col1,
Col2 = @Col2,
Col3 = @Col3,
WHERE ID = @ID
GO
Thanks for any help.