--SELECT
--  no_polis,
--	no_proposal,
--	nama_perusahaan,
--	no_ref
--FROM
--	dbo.gt_lapse_header
--WHERE
--  no_polis <> '1991.0150.0'
--------------------------------
DECLARE @no_ref VARCHAR(12)

DECLARE list_cursor CURSOR FOR  
SELECT
	no_ref
FROM
	dbo.gt_lapse_header
WHERE
  no_polis <> '1991.0150.0'

OPEN list_cursor  
FETCH NEXT FROM list_cursor INTO @no_ref  

WHILE @@FETCH_STATUS = 0  
BEGIN  

  DECLARE	@return_value int

  EXEC	@return_value = [dbo].[proc_SetNoteTerbit] @no_ref

  PRINT @no_ref + ': '
  PRINT @return_value
    
  FETCH NEXT FROM list_cursor INTO @no_ref  
END  

CLOSE list_cursor  
DEALLOCATE list_cursor 