IF (NOT EXISTS 
	(SELECT * FROM INFORMATION_SCHEMA.TABLES 
    WHERE TABLE_NAME = 'pal_CampaignType'))
BEGIN
	CREATE TABLE [dbo].[pal_CampaignType](
		[recId] [int] IDENTITY(1,1) NOT NULL,
		[campaignType] [varchar](250) NULL,
		[isActive] [bit] NULL,
	 CONSTRAINT [PK_pal_CampaignType] PRIMARY KEY CLUSTERED 
	(
		[recId] ASC
	)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
	) ON [PRIMARY]

	IF(SELECT COUNT(1) FROM pal_Setup WHERE code = 'STUD-1') > 0
	BEGIN
		INSERT INTO pal_CampaignType
		VALUES 
		('Subscriber Communication',0),
		('Appointment Reminder',0),
		('General',1)
	END
	ELSE
	BEGIN
		INSERT INTO pal_CampaignType
		VALUES 
		('Subscriber Communication',1),
		('Appointment Reminder',1),
		('General',1)
	END

END
