alter table dbo.QW_ORGANIZATION
add qw_cocode [varchar] (255) NULL
go

CREATE VIEW dbo.QW_DD_EMPLOYEEREACHBY_VW AS
SELECT qw_enumvalue AS pkey, qw_enumlabel AS value
FROM QW_FIELDINFO
JOIN QW_FIELDINFO_TYPE ON QW_FIELDINFO_TYPE.qw_fieldinfo_type_id=QW_FIELDINFO.qw_fieldinfo_type_id
WHERE (qw_tablename = 'qw_employee')
  AND (QW_FIELDINFO_TYPE.qw_name = 'qw_reachby')
GO

INSERT INTO QW_FIELDINFO_TYPE(qw_fieldinfo_type_id, qw_name, qw_description) VALUES (8, 'qw_reachby', null);
go
INSERT INTO QW_FIELDINFO (qw_tablename,qw_fieldinfo_type_id,qw_columntype,qw_enumvalue,qw_enumlabel) VALUES ('qw_employee',8,14,0,'Email');
INSERT INTO QW_FIELDINFO (qw_tablename,qw_fieldinfo_type_id,qw_columntype,qw_enumvalue,qw_enumlabel) VALUES ('qw_employee',8,14,1,'Phone');
GO

-- all new update scripts must include a line like this:
UPDATE QX_SYS_PROP SET PROP_VAL = '010' WHERE (PROP_ID = 'DB_APP_VERSION');
