

    DECLARE @Schema				Nvarchar(200) 
    DECLARE @SqlString			NVarchar(MAX)=''
    DECLARE @Variable			Nvarchar(max)= ' DECLARE @Statement Nvarchar(MAX) ' 
    DECLARE @ObjectName         Nvarchar(200)
		
	DECLARE POP CURSOR for
		   SELECT FNY_Name FROM Common.FinancialYear where ISNULL(FNY_CloseDate_Int ,0) = 0
	OPEN POP
	FETCH NEXT FROM POP INTO @Schema
	WHILE @@FETCH_STATUS =0
	BEGIN  
	        SET @ObjectName = ''
	        SET @ObjectName = 'SHC_VipDecreaseCharge'
	        
	        SET @SqlString = ''
			SET @SqlString=@Variable+'
			
			drop procedure ['+@Schema+'].'+@ObjectName+'
			
			SELECT @Statement = REPLACE(REPLACE(REPLACE(OBJECT_DEFINITION (object_id(''[Orginal].'+@ObjectName+''')),
			                    ''[Orginal].'',''['+@Schema+'].''),''Orginal.'','''+@Schema+'.'')
			                    ,''Orginal#'','''+@Schema+''')
			exec sp_executeSQL @Statement
			'
			EXEC (@SqlString)
	       
            --**********************************

	        SET @ObjectName = ''
	        SET @ObjectName = 'SHC_VipApplyGiftCharge'

	        SET @SqlString = ''
			SET @SqlString=@Variable+'
			
			drop procedure ['+@Schema+'].'+@ObjectName+'
			
			SELECT @Statement = REPLACE(REPLACE(REPLACE(OBJECT_DEFINITION (object_id(''[Orginal].'+@ObjectName+''')),
			                    ''[Orginal].'',''['+@Schema+'].''),''Orginal.'','''+@Schema+'.'')
			                    ,''Orginal#'','''+@Schema+''')
			exec sp_executeSQL @Statement
			'
			EXEC (@SqlString)
	        

            --**********************************

	        SET @ObjectName = ''
	        SET @ObjectName = 'FCS_InsertRadinScaleMKIIFactorFromInvoice'

	        SET @SqlString = ''
			SET @SqlString=@Variable+'
			
			drop procedure ['+@Schema+'].'+@ObjectName+'
			
			SELECT @Statement = REPLACE(REPLACE(REPLACE(OBJECT_DEFINITION (object_id(''[Orginal].'+@ObjectName+''')),
			                    ''[Orginal].'',''['+@Schema+'].''),''Orginal.'','''+@Schema+'.'')
			                    ,''Orginal#'','''+@Schema+''')
			exec sp_executeSQL @Statement
			'
			EXEC (@SqlString)
	        

            --**********************************            

	        SET @ObjectName = ''
	        SET @ObjectName = 'FCS_Insert'

	        SET @SqlString = ''
			SET @SqlString=@Variable+'
			
			drop procedure ['+@Schema+'].'+@ObjectName+'
			
			SELECT @Statement = REPLACE(REPLACE(REPLACE(OBJECT_DEFINITION (object_id(''[Orginal].'+@ObjectName+''')),
			                    ''[Orginal].'',''['+@Schema+'].''),''Orginal.'','''+@Schema+'.'')
			                    ,''Orginal#'','''+@Schema+''')
			exec sp_executeSQL @Statement
			'
			EXEC (@SqlString)
	        

            --********************************** 				
		   FETCH NEXT FROM POP INTO @Schema
    END
    CLOSE POP
    DEALLOCATE POP	