delete from QX_SYS_PROP where prop_id = 'INCOM_EMAIL_TICKET_BUILDVERSION'
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, 'INCOM_EMAIL_TICKET_BUILDVERSION', '-1000', 'Email processing - default ticket buildversion', 1)
go


DECLARE @id int
EXEC dbo.QX_NEXT_KEY 'QX_SYS_PROP', 1, @id OUTPUT
insert into QX_SYS_PROP values (@id, 'INCOM_EMAIL_INTER_DEFAULT_DESC_TEXT', 'Empty email body', NULL, NULL, 0, 'Default Email text used in Email processing.')
EXEC dbo.QX_NEXT_KEY 'QX_SYS_PROP', 1, @id OUTPUT
insert into QX_SYS_PROP values (@id, 'INCOM_EMAIL_TICKET_RVERSION', '-1000', NULL, NULL, 0, 'Default Ticket Repbuild Version – used in Email processing.')
EXEC dbo.QX_NEXT_KEY 'QX_SYS_PROP', 1, @id OUTPUT
insert into QX_SYS_PROP values (@id, 'INCOM_EMAIL_TICKET_AGENT', '0', NULL, NULL, 0, 'Default Ticket Agent – used in Email processing.')
EXEC dbo.QX_NEXT_KEY 'QX_SYS_PROP', 1, @id OUTPUT
insert into QX_SYS_PROP values (@id, 'INCOM_EMAIL_TICKET_PRODUCT', '-1000', NULL, NULL, 0, 'Default Ticket Product – used in Email processing.')
go


DECLARE @id int
EXEC dbo.QX_NEXT_KEY 'QX_TASK', 1, @id OUTPUT
DECLARE @idScript int
select @idScript = script_id from qx_script where script_name = 'Inbox'
insert into QX_TASK (task_id, task_name, task_status_id, script_id, creator_id, date_created,
first_start, next_start, delay, task_delayunit_id, repeat_sign)
values(@id, 'email_proc', 1, @idScript, 0, '2007-03-06', '2007-03-08', '2007-03-08', 1, 0, 1)
go

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