delete from QX_SYS_PROP where PROP_ID in ('INCOM_EMAIL_TICKET_STATUS', 'INCOM_EMAIL_TICKET_PRIORITY', 'INCOM_EMAIL_TICKET_TYPE',
'INCOM_EMAIL_TICKET_SOURCE', 'INCOM_EMAIL_TICKET_IMPACT', 'INCOM_EMAIL_TICKET_OWNER', 'INCOM_EMAIL_TICKET_BUILDVERSION', 'INCOM_EMAIL_INTER_SOURCE',
'INCOM_EMAIL_INTER_DEFAULT_AGENT', 'INCOM_EMAIL_TICKET_RVERSION', 'INCOM_EMAIL_TICKET_AGENT', 'INCOM_EMAIL_TICKET_PRODUCT',
'INCOM_EMAIL_DEFAULT_CUSTOMER_NAME', 'INCOM_EMAIL_DEFAULT_CUSTOMER_ID')
go

DECLARE @id int
EXEC dbo.QX_NEXT_KEY 'QX_SYS_PROP', 1, @id OUTPUT
insert into QX_SYS_PROP (PKEY, PROP_ID, PROP_VAL, DESCRIPTION, NEED_RESTART)
values (@id, 'IN_EMAIL_TICKET_STATUS', '1', 'Email processing - default ticket status', 1)
EXEC dbo.QX_NEXT_KEY 'QX_SYS_PROP', 1, @id OUTPUT
insert into QX_SYS_PROP (PKEY, PROP_ID, PROP_VAL, DESCRIPTION, NEED_RESTART)
values (@id, 'IN_EMAIL_TICKET_PRIORITY', '1', 'Email processing - default ticket priority', 1)
EXEC dbo.QX_NEXT_KEY 'QX_SYS_PROP', 1, @id OUTPUT
insert into QX_SYS_PROP (PKEY, PROP_ID, PROP_VAL, DESCRIPTION, NEED_RESTART)
values (@id, 'IN_EMAIL_TICKET_TYPE', '1', 'Email processing - default ticket type', 1)
EXEC dbo.QX_NEXT_KEY 'QX_SYS_PROP', 1, @id OUTPUT
insert into QX_SYS_PROP (PKEY, PROP_ID, PROP_VAL, DESCRIPTION, NEED_RESTART)
values (@id, 'IN_EMAIL_TICKET_SOURCE', '1', 'Email processing - default ticket source', 1)
EXEC dbo.QX_NEXT_KEY 'QX_SYS_PROP', 1, @id OUTPUT
insert into QX_SYS_PROP (PKEY, PROP_ID, PROP_VAL, DESCRIPTION, NEED_RESTART)
values (@id, 'IN_EMAIL_TICKET_IMPACT', '1', 'Email processing - default ticket impact', 1)
EXEC dbo.QX_NEXT_KEY 'QX_SYS_PROP', 1, @id OUTPUT
insert into QX_SYS_PROP (PKEY, PROP_ID, PROP_VAL, DESCRIPTION, NEED_RESTART)
values (@id, 'IN_EMAIL_TICKET_OWNER', '1', 'Email processing - default ticket owner', 1)
EXEC dbo.QX_NEXT_KEY 'QX_SYS_PROP', 1, @id OUTPUT
insert into QX_SYS_PROP (PKEY, PROP_ID, PROP_VAL, DESCRIPTION, NEED_RESTART)
values (@id, 'IN_EMAIL_TICKET_BUILDVERSION', '-1000', 'Email processing - default ticket buildversion', 1)
EXEC dbo.QX_NEXT_KEY 'QX_SYS_PROP', 1, @id OUTPUT
insert into QX_SYS_PROP (PKEY, PROP_ID, PROP_VAL, DESCRIPTION, NEED_RESTART)
values (@id, 'IN_EMAIL_INTER_SOURCE', '3', 'Interaction email filter source field', 1)
EXEC dbo.QX_NEXT_KEY 'QX_SYS_PROP', 1, @id OUTPUT
insert into QX_SYS_PROP (PKEY, PROP_ID, PROP_VAL, DESCRIPTION, NEED_RESTART)
values (@id, 'IN_EMAIL_INTER_DEFAULT_AGENT', '-1000', 'Default Email agent – Primary Key of the Agent used in Email processing.', 1)
EXEC dbo.QX_NEXT_KEY 'QX_SYS_PROP', 1, @id OUTPUT
insert into QX_SYS_PROP (PKEY, PROP_ID, PROP_VAL, DESCRIPTION, NEED_RESTART)
values (@id, 'IN_EMAIL_TICKET_RVERSION', '-1000', 'Default Ticket Repbuild Version – used in Email processing.', 1)
EXEC dbo.QX_NEXT_KEY 'QX_SYS_PROP', 1, @id OUTPUT
insert into QX_SYS_PROP (PKEY, PROP_ID, PROP_VAL, DESCRIPTION, NEED_RESTART)
values (@id, 'IN_EMAIL_TICKET_AGENT', '0', 'Default Ticket Agent – used in Email processing.', 1)
EXEC dbo.QX_NEXT_KEY 'QX_SYS_PROP', 1, @id OUTPUT
insert into QX_SYS_PROP (PKEY, PROP_ID, PROP_VAL, DESCRIPTION, NEED_RESTART)
values (@id, 'IN_EMAIL_TICKET_PRODUCT', '-1000', 'Default Ticket Product – used in Email processing.', 1)
EXEC dbo.QX_NEXT_KEY 'QX_SYS_PROP', 1, @id OUTPUT
insert into QX_SYS_PROP (PKEY, PROP_ID, PROP_VAL, DESCRIPTION, NEED_RESTART)
values (@id, 'IN_EMAIL_DEFAULT_CUSTOMER_NAME', 'Email processing', 'Default Customer name – used in Email processing.', 1)
EXEC dbo.QX_NEXT_KEY 'QX_SYS_PROP', 1, @id OUTPUT
insert into QX_SYS_PROP (PKEY, PROP_ID, PROP_VAL, DESCRIPTION, NEED_RESTART)
values (@id, 'IN_EMAIL_DEFAULT_CUSTOMER_ID', '-1000', 'Default Customer ID – used in Email processing.', 1)

EXEC dbo.QX_NEXT_KEY 'QX_SYS_PROP', 1, @id OUTPUT
insert into QX_SYS_PROP (PKEY, PROP_ID, PROP_VAL, DESCRIPTION, NEED_RESTART)
values (@id, 'OUT_EMAIL_INTER_SOURCE', '1', 'Default Customer name – used in Email processing.', 1)
go


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