CREATE PROC [dbo].[sp_SetLabelValues]
(
	@srcSurfaceId INT --= 3098
)
AS

DECLARE @srcItemId INT

DECLARE myCursor CURSOR FOR
	
	SELECT	I.recId
	FROM	pal_SurfaceItem I
	WHERE	I.surfaceId = @srcSurfaceId		

	OPEN myCursor      
		FETCH NEXT FROM myCursor INTO @srcItemId      
    
	WHILE @@FETCH_STATUS=0 
	BEGIN 		
		EXEC sp_SetItemLabelValues @srcItemId,@srcSurfaceId	 
		--SELECT	@srcItemId,@srcSurfaceId
		FETCH NEXT FROM myCursor INTO @srcItemId         
	END   

CLOSE myCursor      
DEALLOCATE myCursor  
