ALTER TABLE CaseDetails ADD InstanceId varchar(50);
ALTER TABLE CaseStatus ADD InstanceId varchar(50);
ALTER TABLE CaseStatusTrack ADD InstanceId varchar(50);
ALTER TABLE CheckedOutDocument ADD InstanceId varchar(50);
ALTER TABLE DocumentLockStatus ADD InstanceId varchar(50);
ALTER TABLE DocumentStatus ADD InstanceId varchar(50);
ALTER TABLE Event ADD InstanceId varchar(50);
ALTER TABLE LockStatus ADD InstanceId varchar(50);

UPDATE CaseDetails SET InstanceId = '%INSTANCEID%';
UPDATE CaseStatus SET InstanceId = '%INSTANCEID%';
UPDATE CaseStatusTrack SET InstanceId = '%INSTANCEID%';
UPDATE CheckedOutDocument SET InstanceId = '%INSTANCEID%';
UPDATE DocumentLockStatus SET InstanceId = '%INSTANCEID%';
UPDATE DocumentStatus SET InstanceId = '%INSTANCEID%';
UPDATE Event SET InstanceId = '%INSTANCEID%';
UPDATE LockStatus SET InstanceId = '%INSTANCEID%';