--****************************************************************************************************
--*
--*	This script will create the SQL Server tables needed for Microsoft Project Server OLAP cube creation
--*
--*	Privileges needed: member of db_owner or db_ddladmin
--*
--*	Comments
--*	-----------------------------------------------------------------------------------------
--*     1 - In order to specify non-default filegroups, uncomment the "-- ON [PRIMARY]" line 
--*         within each CREATE statement and replace "Primary" with the desired filegroup
--*
--****************************************************************************************************

--****************************************************************************************************
--*		MSP_CUBE_RESOURCES
--****************************************************************************************************

IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_RESOURCES') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_RESOURCES
GO

CREATE TABLE dbo.MSP_CUBE_RESOURCES
(
	RES_ENTRUID int NULL,
	RESOURCENAME nvarchar(255) NULL,
	ENTERPRISE_RESOURCE_CODE1 int NULL,
	ENTERPRISE_RESOURCE_CODE2 int NULL,
	ENTERPRISE_RESOURCE_CODE3 int NULL,
	ENTERPRISE_RESOURCE_CODE4 int NULL,
	ENTERPRISE_RESOURCE_CODE5 int NULL,
	ENTERPRISE_RESOURCE_CODE6 int NULL,
	ENTERPRISE_RESOURCE_CODE7 int NULL,
	ENTERPRISE_RESOURCE_CODE8 int NULL,
	ENTERPRISE_RESOURCE_CODE9 int NULL,
	ENTERPRISE_RESOURCE_CODE10 int NULL,
	ENTERPRISE_RESOURCE_CODE11 int NULL,
	ENTERPRISE_RESOURCE_CODE12 int NULL,
	ENTERPRISE_RESOURCE_CODE13 int NULL,
	ENTERPRISE_RESOURCE_CODE14 int NULL,
	ENTERPRISE_RESOURCE_CODE15 int NULL,
	ENTERPRISE_RESOURCE_CODE16 int NULL,
	ENTERPRISE_RESOURCE_CODE17 int NULL,
	ENTERPRISE_RESOURCE_CODE18 int NULL,
	ENTERPRISE_RESOURCE_CODE19 int NULL,
	ENTERPRISE_RESOURCE_CODE20 int NULL,
	ENTERPRISE_RESOURCE_CODE21 int NULL,
	ENTERPRISE_RESOURCE_CODE22 int NULL,
	ENTERPRISE_RESOURCE_CODE23 int NULL,
	ENTERPRISE_RESOURCE_CODE24 int NULL,
	ENTERPRISE_RESOURCE_CODE25 int NULL,
	ENTERPRISE_RESOURCE_CODE26 int NULL,
	ENTERPRISE_RESOURCE_CODE27 int NULL,
	ENTERPRISE_RESOURCE_CODE28 int NULL,
	ENTERPRISE_RESOURCE_CODE29 int NULL,
	ENTERPRISE_RESOURCE_CODE30 int NULL,
	RES_IS_ACTIVE nvarchar(255) NULL
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ASSN_FACT
--****************************************************************************************************

IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ASSN_FACT') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ASSN_FACT
GO

CREATE TABLE dbo.MSP_CUBE_ASSN_FACT (
	PROJ_UID int NULL,
	RES_ENTRUID int NULL,
	TIME_ID int NULL,
	TIME_DATE datetime NULL,
	ENT_ASSIGNMENT_CODE1 int NULL,
	ENT_ASSIGNMENT_CODE2 int NULL,
	ENT_ASSIGNMENT_CODE3 int NULL,
	ENT_ASSIGNMENT_CODE4 int NULL,
	ENT_ASSIGNMENT_CODE5 int NULL,
	ENT_ASSIGNMENT_CODE6 int NULL,
	ENT_ASSIGNMENT_CODE7 int NULL,
	ENT_ASSIGNMENT_CODE8 int NULL,
	ENT_ASSIGNMENT_CODE9 int NULL,
	ENT_ASSIGNMENT_CODE10 int NULL,
	ENT_ASSIGNMENT_CODE11 int NULL,
	ENT_ASSIGNMENT_CODE12 int NULL,
	ENT_ASSIGNMENT_CODE13 int NULL,
	ENT_ASSIGNMENT_CODE14 int NULL,
	ENT_ASSIGNMENT_CODE15 int NULL,
	ENT_ASSIGNMENT_CODE16 int NULL,
	ENT_ASSIGNMENT_CODE17 int NULL,
	ENT_ASSIGNMENT_CODE18 int NULL,
	ENT_ASSIGNMENT_CODE19 int NULL,
	ENT_ASSIGNMENT_CODE20 int NULL,
	ENT_ASSIGNMENT_CODE21 int NULL,
	ENT_ASSIGNMENT_CODE22 int NULL,
	ENT_ASSIGNMENT_CODE23 int NULL,
	ENT_ASSIGNMENT_CODE24 int NULL,
	ENT_ASSIGNMENT_CODE25 int NULL,
	ENT_ASSIGNMENT_CODE26 int NULL,
	ENT_ASSIGNMENT_CODE27 int NULL,
	ENT_ASSIGNMENT_CODE28 int NULL,
	ENT_ASSIGNMENT_CODE29 int NULL,
	ENT_ASSIGNMENT_CODE30 int NULL,
	ASSN_ACTUALCOST float NULL,
	ASSN_ACTUALOVERTIMEWORK float NULL,
	ASSN_ACTUALWORK float NULL,
	ASSN_BASELINECOST float NULL,
	ASSN_BASELINEWORK float NULL,
	ASSN_COST float NULL,
	ASSN_OVERTIMEWORK float NULL,
	ASSN_REGULARWORK float NULL,
	ASSN_WORK float NULL,
	ASSN_MATERIAL_ACTUALWORK float NULL,
	ASSN_MATERIAL_BASELINEWORK float NULL,
	ASSN_MATERIAL_WORK float NULL,
        ASSN_BOOKING_TYPE smallint NULL DEFAULT 0,
        ASSN_ACTUALWORK_PROTECTED float NULL,
        ASSN_ACTUALOVERTIMEWORK_PROTECTED float NULL
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_1
--****************************************************************************************************

IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_1') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_1
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_1 
(
	ASSN_OUTLINECODE_NAME nvarchar(255) NULL,
	ASSN_OUTLINECODE_DESCRIPTION ntext NULL,
	ASSN_OUTLINECODE_ID int NULL,
	ASSN_OUTLINECODE_PARENTID int NULL 
) 
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_10
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_10') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_10
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_10 
(
	ASSN_OUTLINECODE_NAME nvarchar(255) NULL,
	ASSN_OUTLINECODE_DESCRIPTION ntext NULL,
	ASSN_OUTLINECODE_ID int NULL,
	ASSN_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_11
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_11') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_11
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_11 
(
	ASSN_OUTLINECODE_NAME nvarchar(255) NULL,
	ASSN_OUTLINECODE_DESCRIPTION ntext NULL,
	ASSN_OUTLINECODE_ID int NULL,
	ASSN_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_12
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_12') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_12
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_12 
(
	ASSN_OUTLINECODE_NAME nvarchar(255) NULL,
	ASSN_OUTLINECODE_DESCRIPTION ntext NULL,
	ASSN_OUTLINECODE_ID int NULL,
	ASSN_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_13
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_13') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_13
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_13 
(
	ASSN_OUTLINECODE_NAME nvarchar(255) NULL,
	ASSN_OUTLINECODE_DESCRIPTION ntext NULL,
	ASSN_OUTLINECODE_ID int NULL,
	ASSN_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_14
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_14') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_14
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_14 
(
	ASSN_OUTLINECODE_NAME nvarchar(255) NULL,
	ASSN_OUTLINECODE_DESCRIPTION ntext NULL,
	ASSN_OUTLINECODE_ID int NULL,
	ASSN_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_15
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_15') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_15
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_15 
(
	ASSN_OUTLINECODE_NAME nvarchar(255) NULL,
	ASSN_OUTLINECODE_DESCRIPTION ntext NULL,
	ASSN_OUTLINECODE_ID int NULL,
	ASSN_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_16
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_16') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_16
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_16 
(
	ASSN_OUTLINECODE_NAME nvarchar(255) NULL,
	ASSN_OUTLINECODE_DESCRIPTION ntext NULL,
	ASSN_OUTLINECODE_ID int NULL,
	ASSN_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_17
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_17') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_17
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_17 (
	ASSN_OUTLINECODE_NAME nvarchar(255) NULL,
	ASSN_OUTLINECODE_DESCRIPTION ntext NULL,
	ASSN_OUTLINECODE_ID int NULL,
	ASSN_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_18
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_18') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_18
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_18 (
	ASSN_OUTLINECODE_NAME nvarchar(255) NULL,
	ASSN_OUTLINECODE_DESCRIPTION ntext NULL,
	ASSN_OUTLINECODE_ID int NULL,
	ASSN_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_19
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_19') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_19
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_19 (
	ASSN_OUTLINECODE_NAME nvarchar(255) NULL,
	ASSN_OUTLINECODE_DESCRIPTION ntext NULL,
	ASSN_OUTLINECODE_ID int NULL,
	ASSN_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_2
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_2') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_2
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_2 (
	ASSN_OUTLINECODE_NAME nvarchar(255) NULL,
	ASSN_OUTLINECODE_DESCRIPTION ntext NULL,
	ASSN_OUTLINECODE_ID int NULL,
	ASSN_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_20
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_20') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_20
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_20 (
	ASSN_OUTLINECODE_NAME nvarchar(255) NULL,
	ASSN_OUTLINECODE_DESCRIPTION ntext NULL,
	ASSN_OUTLINECODE_ID int NULL,
	ASSN_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_21
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_21') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_21
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_21 (
	ASSN_OUTLINECODE_NAME nvarchar(255) NULL,
	ASSN_OUTLINECODE_DESCRIPTION ntext NULL,
	ASSN_OUTLINECODE_ID int NULL,
	ASSN_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_22
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_22') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_22
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_22 (
	ASSN_OUTLINECODE_NAME nvarchar(255) NULL,
	ASSN_OUTLINECODE_DESCRIPTION ntext NULL,
	ASSN_OUTLINECODE_ID int NULL,
	ASSN_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_23
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_23') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_23
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_23 (
	ASSN_OUTLINECODE_NAME nvarchar(255) NULL,
	ASSN_OUTLINECODE_DESCRIPTION ntext NULL,
	ASSN_OUTLINECODE_ID int NULL,
	ASSN_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_24
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_24') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_24
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_24 (
	ASSN_OUTLINECODE_NAME nvarchar(255) NULL,
	ASSN_OUTLINECODE_DESCRIPTION ntext NULL,
	ASSN_OUTLINECODE_ID int NULL,
	ASSN_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_25
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_25') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_25
GO


CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_25 (
	ASSN_OUTLINECODE_NAME nvarchar(255) NULL,
	ASSN_OUTLINECODE_DESCRIPTION ntext NULL,
	ASSN_OUTLINECODE_ID int NULL,
	ASSN_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_26
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_26') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_26
GO


CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_26 (
	ASSN_OUTLINECODE_NAME nvarchar(255) NULL,
	ASSN_OUTLINECODE_DESCRIPTION ntext NULL,
	ASSN_OUTLINECODE_ID int NULL,
	ASSN_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO


--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_27
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_27') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_27
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_27 (
	ASSN_OUTLINECODE_NAME nvarchar(255) NULL,
	ASSN_OUTLINECODE_DESCRIPTION ntext NULL,
	ASSN_OUTLINECODE_ID int NULL,
	ASSN_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_28
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_28') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_28
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_28 (
	ASSN_OUTLINECODE_NAME nvarchar(255) NULL,
	ASSN_OUTLINECODE_DESCRIPTION ntext NULL,
	ASSN_OUTLINECODE_ID int NULL,
	ASSN_OUTLINECODE_PARENTID int NULL 
) 
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_29
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_29') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_29
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_29 (
	ASSN_OUTLINECODE_NAME nvarchar(255) NULL,
	ASSN_OUTLINECODE_DESCRIPTION ntext NULL,
	ASSN_OUTLINECODE_ID int NULL,
	ASSN_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_3
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_3') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_3
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_3 (
	ASSN_OUTLINECODE_NAME nvarchar(255) NULL,
	ASSN_OUTLINECODE_DESCRIPTION ntext NULL,
	ASSN_OUTLINECODE_ID int NULL,
	ASSN_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_30
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_30') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_30
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_30 (
	ASSN_OUTLINECODE_NAME nvarchar(255) NULL,
	ASSN_OUTLINECODE_DESCRIPTION ntext NULL,
	ASSN_OUTLINECODE_ID int NULL,
	ASSN_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_4
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_4') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_4
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_4 (
	ASSN_OUTLINECODE_NAME nvarchar(255) NULL,
	ASSN_OUTLINECODE_DESCRIPTION ntext NULL,
	ASSN_OUTLINECODE_ID int NULL,
	ASSN_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_5
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_5') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_5
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_5 (
	ASSN_OUTLINECODE_NAME nvarchar(255) NULL,
	ASSN_OUTLINECODE_DESCRIPTION ntext NULL,
	ASSN_OUTLINECODE_ID int NULL,
	ASSN_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_6
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_6') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_6
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_6 (
	ASSN_OUTLINECODE_NAME nvarchar(255) NULL,
	ASSN_OUTLINECODE_DESCRIPTION ntext NULL,
	ASSN_OUTLINECODE_ID int NULL,
	ASSN_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_7
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_7') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_7
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_7 (
	ASSN_OUTLINECODE_NAME nvarchar(255) NULL,
	ASSN_OUTLINECODE_DESCRIPTION ntext NULL,
	ASSN_OUTLINECODE_ID int NULL,
	ASSN_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_8
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_8') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_8
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_8 (
	ASSN_OUTLINECODE_NAME nvarchar(255) NULL,
	ASSN_OUTLINECODE_DESCRIPTION ntext NULL,
	ASSN_OUTLINECODE_ID int NULL,
	ASSN_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_9
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_9') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_9
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_ASSIGNMENT_OUTLINE_9 (
	ASSN_OUTLINECODE_NAME nvarchar(255) NULL,
	ASSN_OUTLINECODE_DESCRIPTION ntext NULL,
	ASSN_OUTLINECODE_ID int NULL,
	ASSN_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_1
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_1') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_1
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_1 (
	PROJ_OUTLINECODE_NAME nvarchar(255) NULL,
	PROJ_OUTLINECODE_DESCRIPTION ntext NULL,
	PROJ_OUTLINECODE_ID int NULL,
	PROJ_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_10
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_10') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_10
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_10 (
	PROJ_OUTLINECODE_NAME nvarchar(255) NULL,
	PROJ_OUTLINECODE_DESCRIPTION ntext NULL,
	PROJ_OUTLINECODE_ID int NULL,
	PROJ_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_11
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_11') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_11
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_11 (
	PROJ_OUTLINECODE_NAME nvarchar(255) NULL,
	PROJ_OUTLINECODE_DESCRIPTION ntext NULL,
	PROJ_OUTLINECODE_ID int NULL,
	PROJ_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_12
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_12') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_12
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_12 (
	PROJ_OUTLINECODE_NAME nvarchar(255) NULL,
	PROJ_OUTLINECODE_DESCRIPTION ntext NULL,
	PROJ_OUTLINECODE_ID int NULL,
	PROJ_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_13
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_13') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_13
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_13 (
	PROJ_OUTLINECODE_NAME nvarchar(255) NULL,
	PROJ_OUTLINECODE_DESCRIPTION ntext NULL,
	PROJ_OUTLINECODE_ID int NULL,
	PROJ_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_14
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_14') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_14
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_14 (
	PROJ_OUTLINECODE_NAME nvarchar(255) NULL,
	PROJ_OUTLINECODE_DESCRIPTION ntext NULL,
	PROJ_OUTLINECODE_ID int NULL,
	PROJ_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_15
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_15') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_15
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_15 (
	PROJ_OUTLINECODE_NAME nvarchar(255) NULL,
	PROJ_OUTLINECODE_DESCRIPTION ntext NULL,
	PROJ_OUTLINECODE_ID int NULL,
	PROJ_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_16
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_16') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_16
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_16 (
	PROJ_OUTLINECODE_NAME nvarchar(255) NULL,
	PROJ_OUTLINECODE_DESCRIPTION ntext NULL,
	PROJ_OUTLINECODE_ID int NULL,
	PROJ_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_17
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_17') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_17
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_17 (
	PROJ_OUTLINECODE_NAME nvarchar(255) NULL,
	PROJ_OUTLINECODE_DESCRIPTION ntext NULL,
	PROJ_OUTLINECODE_ID int NULL,
	PROJ_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_18
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_18') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_18
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_18 (
	PROJ_OUTLINECODE_NAME nvarchar(255) NULL,
	PROJ_OUTLINECODE_DESCRIPTION ntext NULL,
	PROJ_OUTLINECODE_ID int NULL,
	PROJ_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_19
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_19') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_19
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_19 (
	PROJ_OUTLINECODE_NAME nvarchar(255) NULL,
	PROJ_OUTLINECODE_DESCRIPTION ntext NULL,
	PROJ_OUTLINECODE_ID int NULL,
	PROJ_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_2
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_2') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_2
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_2 (
	PROJ_OUTLINECODE_NAME nvarchar(255) NULL,
	PROJ_OUTLINECODE_DESCRIPTION ntext NULL,
	PROJ_OUTLINECODE_ID int NULL,
	PROJ_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_20
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_20') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_20
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_20 (
	PROJ_OUTLINECODE_NAME nvarchar(255) NULL,
	PROJ_OUTLINECODE_DESCRIPTION ntext NULL,
	PROJ_OUTLINECODE_ID int NULL,
	PROJ_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_21
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_21') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_21
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_21 (
	PROJ_OUTLINECODE_NAME nvarchar(255) NULL,
	PROJ_OUTLINECODE_DESCRIPTION ntext NULL,
	PROJ_OUTLINECODE_ID int NULL,
	PROJ_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_22
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_22') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_22
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_22 (
	PROJ_OUTLINECODE_NAME nvarchar(255) NULL,
	PROJ_OUTLINECODE_DESCRIPTION ntext NULL,
	PROJ_OUTLINECODE_ID int NULL,
	PROJ_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_23
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_23') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_23
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_23 (
	PROJ_OUTLINECODE_NAME nvarchar(255) NULL,
	PROJ_OUTLINECODE_DESCRIPTION ntext NULL,
	PROJ_OUTLINECODE_ID int NULL,
	PROJ_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_24
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_24') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_24
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_24 (
	PROJ_OUTLINECODE_NAME nvarchar(255) NULL,
	PROJ_OUTLINECODE_DESCRIPTION ntext NULL,
	PROJ_OUTLINECODE_ID int NULL,
	PROJ_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_25
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_25') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_25
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_25 (
	PROJ_OUTLINECODE_NAME nvarchar(255) NULL,
	PROJ_OUTLINECODE_DESCRIPTION ntext NULL,
	PROJ_OUTLINECODE_ID int NULL,
	PROJ_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_26
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_26') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_26
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_26 (
	PROJ_OUTLINECODE_NAME nvarchar(255) NULL,
	PROJ_OUTLINECODE_DESCRIPTION ntext NULL,
	PROJ_OUTLINECODE_ID int NULL,
	PROJ_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_27
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_27') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_27
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_27 (
	PROJ_OUTLINECODE_NAME nvarchar(255) NULL,
	PROJ_OUTLINECODE_DESCRIPTION ntext NULL,
	PROJ_OUTLINECODE_ID int NULL,
	PROJ_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_28
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_28') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_28
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_28 (
	PROJ_OUTLINECODE_NAME nvarchar(255) NULL,
	PROJ_OUTLINECODE_DESCRIPTION ntext NULL,
	PROJ_OUTLINECODE_ID int NULL,
	PROJ_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_29
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_29') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_29
GO


CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_29 (
	PROJ_OUTLINECODE_NAME nvarchar(255) NULL,
	PROJ_OUTLINECODE_DESCRIPTION ntext NULL,
	PROJ_OUTLINECODE_ID int NULL,
	PROJ_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_3
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_3') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_3
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_3 (
	PROJ_OUTLINECODE_NAME nvarchar(255) NULL,
	PROJ_OUTLINECODE_DESCRIPTION ntext NULL,
	PROJ_OUTLINECODE_ID int NULL,
	PROJ_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_30
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_30') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_30
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_30 (
	PROJ_OUTLINECODE_NAME nvarchar(255) NULL,
	PROJ_OUTLINECODE_DESCRIPTION ntext NULL,
	PROJ_OUTLINECODE_ID int NULL,
	PROJ_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_4
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_4') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_4
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_4 (
	PROJ_OUTLINECODE_NAME nvarchar(255) NULL,
	PROJ_OUTLINECODE_DESCRIPTION ntext NULL,
	PROJ_OUTLINECODE_ID int NULL,
	PROJ_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_5
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_5') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_5
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_5 (
	PROJ_OUTLINECODE_NAME nvarchar(255) NULL,
	PROJ_OUTLINECODE_DESCRIPTION ntext NULL,
	PROJ_OUTLINECODE_ID int NULL,
	PROJ_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_6
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_6') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_6
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_6 (
	PROJ_OUTLINECODE_NAME nvarchar(255) NULL,
	PROJ_OUTLINECODE_DESCRIPTION ntext NULL,
	PROJ_OUTLINECODE_ID int NULL,
	PROJ_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_7
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_7') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_7
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_7 (
	PROJ_OUTLINECODE_NAME nvarchar(255) NULL,
	PROJ_OUTLINECODE_DESCRIPTION ntext NULL,
	PROJ_OUTLINECODE_ID int NULL,
	PROJ_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_8
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_8') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_8
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_8 (
	PROJ_OUTLINECODE_NAME nvarchar(255) NULL,
	PROJ_OUTLINECODE_DESCRIPTION ntext NULL,
	PROJ_OUTLINECODE_ID int NULL,
	PROJ_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_9
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_9') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_9
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_9 (
	PROJ_OUTLINECODE_NAME nvarchar(255) NULL,
	PROJ_OUTLINECODE_DESCRIPTION ntext NULL,
	PROJ_OUTLINECODE_ID int NULL,
	PROJ_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_1
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_1') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_1
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_1 (
	RES_OUTLINECODE_NAME nvarchar(255) NULL,
	RES_OUTLINECODE_DESCRIPTION ntext NULL,
	RES_OUTLINECODE_ID int NULL,
	RES_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_10
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_10') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_10
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_10 (
	RES_OUTLINECODE_NAME nvarchar(255) NULL,
	RES_OUTLINECODE_DESCRIPTION ntext NULL,
	RES_OUTLINECODE_ID int NULL,
	RES_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_11
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_11') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_11
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_11 (
	RES_OUTLINECODE_NAME nvarchar(255) NULL,
	RES_OUTLINECODE_DESCRIPTION ntext NULL,
	RES_OUTLINECODE_ID int NULL,
	RES_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_12
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_12') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_12
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_12 (
	RES_OUTLINECODE_NAME nvarchar(255) NULL,
	RES_OUTLINECODE_DESCRIPTION ntext NULL,
	RES_OUTLINECODE_ID int NULL,
	RES_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_13
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_13') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_13
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_13 (
	RES_OUTLINECODE_NAME nvarchar(255) NULL,
	RES_OUTLINECODE_DESCRIPTION ntext NULL,
	RES_OUTLINECODE_ID int NULL,
	RES_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_14
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_14') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_14
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_14 (
	RES_OUTLINECODE_NAME nvarchar(255) NULL,
	RES_OUTLINECODE_DESCRIPTION ntext NULL,
	RES_OUTLINECODE_ID int NULL,
	RES_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_15
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_15') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_15
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_15 (
	RES_OUTLINECODE_NAME nvarchar(255) NULL,
	RES_OUTLINECODE_DESCRIPTION ntext NULL,
	RES_OUTLINECODE_ID int NULL,
	RES_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_16
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_16') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_16
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_16 (
	RES_OUTLINECODE_NAME nvarchar(255) NULL,
	RES_OUTLINECODE_DESCRIPTION ntext NULL,
	RES_OUTLINECODE_ID int NULL,
	RES_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_17
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_17') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_17
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_17 (
	RES_OUTLINECODE_NAME nvarchar(255) NULL,
	RES_OUTLINECODE_DESCRIPTION ntext NULL,
	RES_OUTLINECODE_ID int NULL,
	RES_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_18
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_18') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_18
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_18 (
	RES_OUTLINECODE_NAME nvarchar(255) NULL,
	RES_OUTLINECODE_DESCRIPTION ntext NULL,
	RES_OUTLINECODE_ID int NULL,
	RES_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_19
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_19') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_19
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_19 (
	RES_OUTLINECODE_NAME nvarchar(255) NULL,
	RES_OUTLINECODE_DESCRIPTION ntext NULL,
	RES_OUTLINECODE_ID int NULL,
	RES_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_2
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_2') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_2
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_2 (
	RES_OUTLINECODE_NAME nvarchar(255) NULL,
	RES_OUTLINECODE_DESCRIPTION ntext NULL,
	RES_OUTLINECODE_ID int NULL,
	RES_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_20
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_20') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_20
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_20 (
	RES_OUTLINECODE_NAME nvarchar(255) NULL,
	RES_OUTLINECODE_DESCRIPTION ntext NULL,
	RES_OUTLINECODE_ID int NULL,
	RES_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_21
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_21') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_21
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_21 (
	RES_OUTLINECODE_NAME nvarchar(255) NULL,
	RES_OUTLINECODE_DESCRIPTION ntext NULL,
	RES_OUTLINECODE_ID int NULL,
	RES_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_22
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_22') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_22
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_22 (
	RES_OUTLINECODE_NAME nvarchar(255) NULL,
	RES_OUTLINECODE_DESCRIPTION ntext NULL,
	RES_OUTLINECODE_ID int NULL,
	RES_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_23
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_23') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_23
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_23 (
	RES_OUTLINECODE_NAME nvarchar(255) NULL,
	RES_OUTLINECODE_DESCRIPTION ntext NULL,
	RES_OUTLINECODE_ID int NULL,
	RES_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_24
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_24') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_24
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_24 (
	RES_OUTLINECODE_NAME nvarchar(255) NULL,
	RES_OUTLINECODE_DESCRIPTION ntext NULL,
	RES_OUTLINECODE_ID int NULL,
	RES_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_25
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_25') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_25
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_25 (
	RES_OUTLINECODE_NAME nvarchar(255) NULL,
	RES_OUTLINECODE_DESCRIPTION ntext NULL,
	RES_OUTLINECODE_ID int NULL,
	RES_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_26
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_26') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_26
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_26 (
	RES_OUTLINECODE_NAME nvarchar(255) NULL,
	RES_OUTLINECODE_DESCRIPTION ntext NULL,
	RES_OUTLINECODE_ID int NULL,
	RES_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_27
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_27') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_27
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_27 (
	RES_OUTLINECODE_NAME nvarchar(255) NULL,
	RES_OUTLINECODE_DESCRIPTION ntext NULL,
	RES_OUTLINECODE_ID int NULL,
	RES_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_28
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_28') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_28
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_28 (
	RES_OUTLINECODE_NAME nvarchar(255) NULL,
	RES_OUTLINECODE_DESCRIPTION ntext NULL,
	RES_OUTLINECODE_ID int NULL,
	RES_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_29
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_29') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_29
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_29 (
	RES_OUTLINECODE_NAME nvarchar(255) NULL,
	RES_OUTLINECODE_DESCRIPTION ntext NULL,
	RES_OUTLINECODE_ID int NULL,
	RES_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_3
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_3') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_3
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_3 (
	RES_OUTLINECODE_NAME nvarchar(255) NULL,
	RES_OUTLINECODE_DESCRIPTION ntext NULL,
	RES_OUTLINECODE_ID int NULL,
	RES_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_30
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_30') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_30
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_30 (
	RES_OUTLINECODE_NAME nvarchar(255) NULL,
	RES_OUTLINECODE_DESCRIPTION ntext NULL,
	RES_OUTLINECODE_ID int NULL,
	RES_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_4
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_4') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_4
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_4 (
	RES_OUTLINECODE_NAME nvarchar(255) NULL,
	RES_OUTLINECODE_DESCRIPTION ntext NULL,
	RES_OUTLINECODE_ID int NULL,
	RES_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_5
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_5') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_5
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_5 (
	RES_OUTLINECODE_NAME nvarchar(255) NULL,
	RES_OUTLINECODE_DESCRIPTION ntext NULL,
	RES_OUTLINECODE_ID int NULL,
	RES_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_6
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_6') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_6
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_6 (
	RES_OUTLINECODE_NAME nvarchar(255) NULL,
	RES_OUTLINECODE_DESCRIPTION ntext NULL,
	RES_OUTLINECODE_ID int NULL,
	RES_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_7
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_7') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_7
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_7 (
	RES_OUTLINECODE_NAME nvarchar(255) NULL,
	RES_OUTLINECODE_DESCRIPTION ntext NULL,
	RES_OUTLINECODE_ID int NULL,
	RES_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_8
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_8') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_8
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_8 (
	RES_OUTLINECODE_NAME nvarchar(255) NULL,
	RES_OUTLINECODE_DESCRIPTION ntext NULL,
	RES_OUTLINECODE_ID int NULL,
	RES_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_9
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_9') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_9
GO

CREATE TABLE dbo.MSP_CUBE_ENTERPRISE_RESOURCE_OUTLINE_9 (
	RES_OUTLINECODE_NAME nvarchar(255) NULL,
	RES_OUTLINECODE_DESCRIPTION ntext NULL,
	RES_OUTLINECODE_ID int NULL,
	RES_OUTLINECODE_PARENTID int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_PROJECTS
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_PROJECTS') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_PROJECTS
GO

CREATE TABLE dbo.MSP_CUBE_PROJECTS (
	PROJ_UID int NULL,
	PROJ_NAME nvarchar(255) NULL,
	PROJ_PROP_TITLE ntext NULL,
	PROJ_VERSION_UID int NULL,
	ENTERPRISE_PROJECT_CODE1 int NULL,
	ENTERPRISE_PROJECT_CODE2 int NULL,
	ENTERPRISE_PROJECT_CODE3 int NULL,
	ENTERPRISE_PROJECT_CODE4 int NULL,
	ENTERPRISE_PROJECT_CODE5 int NULL,
	ENTERPRISE_PROJECT_CODE6 int NULL,
	ENTERPRISE_PROJECT_CODE7 int NULL,
	ENTERPRISE_PROJECT_CODE8 int NULL,
	ENTERPRISE_PROJECT_CODE9 int NULL,
	ENTERPRISE_PROJECT_CODE10 int NULL,
	ENTERPRISE_PROJECT_CODE11 int NULL,
	ENTERPRISE_PROJECT_CODE12 int NULL,
	ENTERPRISE_PROJECT_CODE13 int NULL,
	ENTERPRISE_PROJECT_CODE14 int NULL,
	ENTERPRISE_PROJECT_CODE15 int NULL,
	ENTERPRISE_PROJECT_CODE16 int NULL,
	ENTERPRISE_PROJECT_CODE17 int NULL,
	ENTERPRISE_PROJECT_CODE18 int NULL,
	ENTERPRISE_PROJECT_CODE19 int NULL,
	ENTERPRISE_PROJECT_CODE20 int NULL,
	ENTERPRISE_PROJECT_CODE21 int NULL,
	ENTERPRISE_PROJECT_CODE22 int NULL,
	ENTERPRISE_PROJECT_CODE23 int NULL,
	ENTERPRISE_PROJECT_CODE24 int NULL,
	ENTERPRISE_PROJECT_CODE25 int NULL,
	ENTERPRISE_PROJECT_CODE26 int NULL,
	ENTERPRISE_PROJECT_CODE27 int NULL,
	ENTERPRISE_PROJECT_CODE28 int NULL,
	ENTERPRISE_PROJECT_CODE29 int NULL,
	ENTERPRISE_PROJECT_CODE30 int NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_PROJ_VERSIONS
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_PROJ_VERSIONS') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_PROJ_VERSIONS
GO

CREATE TABLE dbo.MSP_CUBE_PROJ_VERSIONS 
(
	PROJ_VERSION_UID int NULL,
	PROJ_VERSION nvarchar(120) NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_RES_AVAIL_FACT
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_RES_AVAIL_FACT') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_RES_AVAIL_FACT
GO

CREATE TABLE dbo.MSP_CUBE_RES_AVAIL_FACT 
(
	RES_ENTRUID int NULL,
	TIME_ID int NULL,
	TIME_DATE datetime NULL,
	RES_AVAIL float NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_TIME_BY_DAY
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_TIME_BY_DAY') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_TIME_BY_DAY
GO

CREATE TABLE dbo.MSP_CUBE_TIME_BY_DAY 
(
	TIME_ID int NULL,
	TIME_DATE datetime NULL,
	TIME_DAY nvarchar(32) NULL,
	TIME_MONTH nvarchar(32) NULL,
	TIME_YEAR int NULL,
	TIME_DAY_OF_MONTH int NULL,
	TIME_WEEK_OF_YEAR int NULL,
	TIME_MONTH_OF_YEAR int NULL,
	TIME_QTR nvarchar(32) NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ASSN_BOOKING 
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ASSN_BOOKING') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ASSN_BOOKING 
GO

CREATE TABLE dbo.MSP_CUBE_ASSN_BOOKING 
(
        ASSN_BOOKING_TYPE smallint NOT NULL,
        ASSN_BOOKING_DESC nvarchar(255) NOT NULL 
)
-- ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_RESERVED_CACHED_REDIRECTION_ASSN_CODE
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_RESERVED_CACHED_REDIRECTION_ASSN_CODE') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_RESERVED_CACHED_REDIRECTION_ASSN_CODE 
GO

CREATE TABLE dbo.MSP_CUBE_RESERVED_CACHED_REDIRECTION_ASSN_CODE
(
	AssnOutlineCodeIndex              int NOT NULL,
	ViewAssnEntOutlineCodeValue       int NOT NULL,
	CubeAssnEntOutlineCodeValue       int NOT NULL,
	CONSTRAINT PK_MSP_CUBE_RESERVED_CACHED_REDIRECTION_ASSN_CODE PRIMARY KEY CLUSTERED (AssnOutlineCodeIndex,ViewAssnEntOutlineCodeValue)
)
-- ON [PRIMARY]
GO




-- End of script

