Script intended to Activate/Deactivate a specific EASY REG(tm) field per a specific Site
USE StickyFish
GO
DECLARE @SiteID INT
DECLARE @FieldID INT
DECLARE @IsDisplayed BIT
-- Script intended to Activate/Deactivate a specific EASY REG(tm) field per a specific Site
-- Easy Reg
-- MetadataCategoryID = 4
-- Easy Reg FieldIDs
-- 200101 'Email'
-- 200102 'Password'
-- 200103 'ConfirmPassword'
-- 200104 'DefaultSubscriptions'
-- 200105 'Zip'
-- 200106 'Gender'
-- 200107 'DOB'
---------------------- Edit Here ------------------
SET @SiteID = 3679 -- KSSX KISS Rewards
SET @FieldID = 200107 -- DOB
SET @IsDisplayed = 1
UPDATE FieldMetadata
SET IsDisplayed = @IsDisplayed
WHERE FieldID = @FieldID
AND FieldMetadataID IN (
SELECT FieldMetaDataID FROM Site_FieldMetadata sfm WITH (NOLOCK)
WHERE sfm.SiteID = @SiteID and sfm.MetadataCategoryID = 4
)