IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE
	TABLE_NAME = 'pal_Setup' AND
	COLUMN_NAME = 'emailSubjectWholesalerOrder')
BEGIN
	ALTER TABLE	[dbo].[pal_Setup]
		ADD emailSubjectWholesalerOrder NVARCHAR(200) NULL
END

IF EXISTS (SELECT 1 FROM [dbo].[pal_Setup] WHERE recId = 1 AND emailSubjectWholesalerOrder IS NULL)
UPDATE [dbo].[pal_Setup] SET emailSubjectWholesalerOrder = '{CompanyName} - Purchase Order [{WholesalerName} - {OrderNumber}]' where recId = 1;
GO