SPROC Comment - Begin Return Select <- do not remove

rito1
rito1 used Ask the Experts™
on
Hi All,

I have been using a great tool called 'SSMS Tools' within SQL 2008, it has been a life saver as far as productivity goes.

Now when it auto generates my stored procedures it looks similar to the attached.

Now its been bugging me for a while by why do I need to include the following section within my SPROC as per the tool's comments?:

-- Begin Return Select <- do not remove
      
SELECT [CatID], [AlbumID], [PageTitle], [PageDesc], [IsEnabled]
      
FROM   [dbo].[album_categories]
      
WHERE  [CatID] = @CatID      
      
-- End Return Select <- do not remove


Is there a particular reason to include this?.. It seems to work without it. Obviously if there is a valid reason then I will leave this part in tact.

Many thanks,

Rit

      
CREATE PROC [dbo].[sproc_upd_album_categories] 
    
	@CatID int,
    	@AlbumID int,
    	@PageTitle nvarchar(100),
    	@PageDesc nvarchar(500),
    	@IsEnabled bit


AS 
	

SET NOCOUNT ON 
SET XACT_ABORT ON  


BEGIN TRAN

	

UPDATE [dbo].[album_categories]
	
SET    [AlbumID] = @AlbumID, [PageTitle] = @PageTitle, [PageDesc] = @PageDesc, [IsEnabled] = @IsEnabled
	
WHERE  [CatID] = @CatID
	
	

-- Begin Return Select <- do not remove
	
SELECT [CatID], [AlbumID], [PageTitle], [PageDesc], [IsEnabled]
	
FROM   [dbo].[album_categories]
	
WHERE  [CatID] = @CatID	
	
-- End Return Select <- do not remove

	

COMMIT TRAN

GO

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Billing Engineer
Most Valuable Expert 2014
Top Expert 2009
Commented:
do you refer to the comments as such, or the whole part?
I don't know the tool, so I don't know what the feature of the created procedure should be.
the code does return the rows as indicated, if your application that calls the procedure does not need those, you can, of course, remove those lines...

Author

Commented:
Thank you. Perfect answer.

Rit

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial