ALTER TABLE VCLib.T_USER_CONTEXTS ADD COLUMN "readonlystate" integer NULL;

UPDATE VCLib.T_USER_CONTEXTS 
SET "readonlystate" = ("readonly")::int;

ALTER TABLE VCLib.T_USER_CONTEXTS ALTER COLUMN "readonlystate" SET NOT NULL;

call public.sp_alterdropcolumn('VCLib.T_USER_CONTEXTS' , 'ReadOnly'); 