IF EXISTS(
    SELECT * FROM sys.columns 
    WHERE Name      = N'campaignTitle'
      AND Object_ID = Object_ID(N'pal_Campaign'))
BEGIN
	ALTER TABLE [dbo].[pal_Campaign] ALTER COLUMN [campaignTitle] VARCHAR (250) NULL;
END

IF EXISTS(
    SELECT * FROM sys.columns 
    WHERE Name      = N'filterValue'
      AND Object_ID = Object_ID(N'pal_Campaign'))
BEGIN
	ALTER TABLE [dbo].[pal_Campaign] ALTER COLUMN [filterValue] VARCHAR (500) NULL;
END

IF EXISTS ( SELECT * 
            FROM   sysobjects 
            WHERE  id = object_id(N'[dbo].[sp_STUD1_GetReportTermlyGrade8Average]') 
                   and OBJECTPROPERTY(id, N'IsProcedure') = 1 )
BEGIN
    DROP PROCEDURE [dbo].sp_STUD1_GetReportTermlyGrade8Average
END

IF EXISTS ( SELECT * 
            FROM   sysobjects 
            WHERE  id = object_id(N'[dbo].[sp_STUD1_GetReportTermlyGrade9Average]') 
                   and OBJECTPROPERTY(id, N'IsProcedure') = 1 )
BEGIN
    DROP PROCEDURE [dbo].sp_STUD1_GetReportTermlyGrade9Average
END

IF EXISTS ( SELECT * 
            FROM   sysobjects 
            WHERE  id = object_id(N'[dbo].[sp_STUD1_GetReportTermlyGrade10Average]') 
                   and OBJECTPROPERTY(id, N'IsProcedure') = 1 )
BEGIN
    DROP PROCEDURE [dbo].sp_STUD1_GetReportTermlyGrade10Average
END

IF EXISTS ( SELECT * 
            FROM   sysobjects 
            WHERE  id = object_id(N'[dbo].[sp_STUD1_GetReportTermlyGrade11Average]') 
                   and OBJECTPROPERTY(id, N'IsProcedure') = 1 )
BEGIN
    DROP PROCEDURE [dbo].sp_STUD1_GetReportTermlyGrade11Average
END

IF EXISTS ( SELECT * 
            FROM   sysobjects 
            WHERE  id = object_id(N'[dbo].[sp_STUD1_GetReportTermlyGrade12Average]') 
                   and OBJECTPROPERTY(id, N'IsProcedure') = 1 )
BEGIN
    DROP PROCEDURE [dbo].sp_STUD1_GetReportTermlyGrade12Average
END

