if exists (select * from dbo.sysobjects where id = object_id(N'FK_QX_REPORT_QX_USER_TYPE') and xtype = 'F')
alter table QX_REPORT drop constraint FK_QX_REPORT_QX_USER_TYPE
go

if exists (select * from dbo.sysindexes where name = N'IDX_QX_REPORT_OWNER_TYPE' and id = object_id(N'QX_REPORT'))
drop index QX_REPORT.IDX_QX_REPORT_OWNER_TYPE
GO
alter table QX_REPORT drop column OWNER_TYPE
go

if exists (select * from dbo.sysindexes where name = N'IDX_QX_REPORT_FOCUS' and id = object_id(N'QX_REPORT'))
drop index QX_REPORT.IDX_QX_REPORT_FOCUS
GO
alter table QX_REPORT drop column focus_id
go

alter table QX_REPORT drop column STYLE
go

UPDATE QX_SYS_PROP SET PROP_VAL = '034' WHERE (PROP_ID = 'DB_CORE_VERSION');
go
