/*
--CopyRight(C) 2003, NTT All rights reserved
--
--	XMS2データベーステーブルの作成
--		変更履歴
--			2004.01.08  新規作成  横山 豪
--	XMS2データベーステーブルを新規作成します。
--
*/

USE %DB_NAME%

GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[PropagateRelation]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[PropagateRelation]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[AiccComment]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[AiccComment]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[AiccCore]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[AiccCore]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[SectionLog]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[SectionLog]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[AiccInteraction]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[AiccInteraction]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[AiccObjectives]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[AiccObjectives]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Assignments]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Assignments]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ConferenceLo]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ConferenceLo]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Evaluate]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Evaluate]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ExchangeLo]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ExchangeLo]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Face2FaceLo]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Face2FaceLo]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[GroupAndPeople]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[GroupAndPeople]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Groups]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Groups]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[LO]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[LO]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[LOHistory]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[LOHistory]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[LOLog]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[LOLog]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[LOLogSession]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[LOLogSession]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[LORelation]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[LORelation]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[LOType]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[LOType]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[OfficeLo]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[OfficeLo]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[People]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[People]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[RoleAssignments]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[RoleAssignments]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Roles]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Roles]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[XmoRelation]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[XmoRelation]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[RolesFunction]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[RolesFunction]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[SPSLo]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[SPSLo]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ServerInformation]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ServerInformation]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[SmartForceLo]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[SmartForceLo]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[URLLo]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[URLLo]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[LaunchForgetLo]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[LaunchForgetLo]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[WbtLo]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[WbtLo]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[XMOEntry]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[XMOEntry]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[PerceptionLo]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[PerceptionLo]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[OL_AiccComment]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[OL_AiccComment]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[OL_AiccCore]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[OL_AiccCore]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[OL_AiccInteraction]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[OL_AiccInteraction]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[OL_AiccObjectives]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[OL_AiccObjectives]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[OL_SectionLog]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[OL_SectionLog]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[OfflineLo]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[OfflineLo]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[CatalogLo]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[CatalogLo]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[CatalogLo_LoList]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[CatalogLo_LoList]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[prerequisite]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[prerequisite]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ScormLo]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ScormLo]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ScormSession]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ScormSession]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Scorm_Attempt]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Scorm_Attempt]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Scorm_Interaction]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Scorm_Interaction]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Scorm_LMSComment]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Scorm_LMSComment]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Scorm_LearnerComment]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Scorm_LearnerComment]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Scorm_Objective]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Scorm_Objective]
GO



CREATE TABLE [dbo].[PropagateRelation] (
	[LOID] [char] (10) COLLATE Japanese_CI_AS NULL ,
	[RelatedID] [char] (10) COLLATE Japanese_CI_AS NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[AiccComment] (
	[UserID] [char] (8) COLLATE Japanese_CI_AS NOT NULL ,
	[LOID] [char] (10) COLLATE Japanese_CI_AS NOT NULL ,
	[SessionID] [char] (128) COLLATE Japanese_CI_AS NOT NULL ,
	[UID] [char] (255) COLLATE Japanese_CI_AS NOT NULL ,
	[course_id] [varchar] (255) COLLATE Japanese_CI_AS NULL ,
	[student_id] [char] (10) COLLATE Japanese_CI_AS NULL ,
	[lesson_id] [varchar] (255) COLLATE Japanese_CI_AS NULL ,
	[date] [datetime] NULL ,
	[time] [char] (16) COLLATE Japanese_CI_AS NULL ,
	[location] [varchar] (255) COLLATE Japanese_CI_AS NULL ,
	[comment] [varchar] (4096) COLLATE Japanese_CI_AS NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[AiccCore] (
	[UserID] [char] (8) COLLATE Japanese_CI_AS NOT NULL ,
	[LOID] [char] (10) COLLATE Japanese_CI_AS NOT NULL ,
	[SessionID] [char] (128) COLLATE Japanese_CI_AS NOT NULL ,
	[UID] [char] (255) COLLATE Japanese_CI_AS NOT NULL ,
	[Lesson_Status] [varchar] (30) COLLATE Japanese_CI_AS NULL ,
	[RawScore] [float] NULL ,
	[MaxScore] [float] NULL ,
	[MinScore] [float] NULL ,
	[Time] [char] (16) COLLATE Japanese_CI_AS NULL ,
	[Lesson_Location] [varchar] (255) COLLATE Japanese_CI_AS NULL ,
	[exist] [char] (10) COLLATE Japanese_CI_AS NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[SectionLog] (
	[UserID] [char] (8) COLLATE Japanese_CI_AS NOT NULL ,
	[LOID] [char] (10) COLLATE Japanese_CI_AS NOT NULL ,
	[SessionID] [char] (128) COLLATE Japanese_CI_AS NOT NULL ,
	[UID] [char] (255) COLLATE Japanese_CI_AS NOT NULL ,
	[Lesson_Status] [varchar] (30) COLLATE Japanese_CI_AS NULL ,
	[Time] [char] (16) COLLATE Japanese_CI_AS NULL ,
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[AiccInteraction] (
	[UserID] [char] (8) COLLATE Japanese_CI_AS NOT NULL ,
	[LOID] [char] (10) COLLATE Japanese_CI_AS NOT NULL ,
	[SessionID] [char] (128) COLLATE Japanese_CI_AS NOT NULL ,
	[UID] [char] (255) COLLATE Japanese_CI_AS NOT NULL ,
	[course_id] [varchar] (255) COLLATE Japanese_CI_AS NULL ,
	[student_id] [char] (10) COLLATE Japanese_CI_AS NULL ,
	[lesson_id] [varchar] (255) COLLATE Japanese_CI_AS NULL ,
	[response_times] [int] NOT NULL ,
	[date] [datetime] NULL ,
	[time] [char] (16) COLLATE Japanese_CI_AS NULL ,
	[interaction_id] [varchar] (255) COLLATE Japanese_CI_AS NULL ,
	[objective_id] [varchar] (255) COLLATE Japanese_CI_AS NULL ,
	[type_interaction] [char] (30) COLLATE Japanese_CI_AS NULL ,
	[correct_response] [varchar] (4096) COLLATE Japanese_CI_AS NULL ,
	[response_value] [char] (30) COLLATE Japanese_CI_AS NULL ,
	[student_response] [varchar] (255) COLLATE Japanese_CI_AS NULL ,
	[result] [char] (30) COLLATE Japanese_CI_AS NULL ,
	[weighting] [float] NULL ,
	[latency] [char] (16) COLLATE Japanese_CI_AS NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[AiccObjectives] (
	[UserID] [char] (8) COLLATE Japanese_CI_AS NOT NULL ,
	[LOID] [char] (10) COLLATE Japanese_CI_AS NOT NULL ,
	[SessionID] [char] (128) COLLATE Japanese_CI_AS NOT NULL ,
	[UID] [char] (255) COLLATE Japanese_CI_AS NOT NULL ,
	[course_id] [varchar] (255) COLLATE Japanese_CI_AS NULL ,
	[student_id] [char] (10) COLLATE Japanese_CI_AS NULL ,
	[lesson_id] [varchar] (255) COLLATE Japanese_CI_AS NULL ,
	[date] [datetime] NULL ,
	[time] [char] (16) COLLATE Japanese_CI_AS NULL ,
	[objective_id] [varchar] (255) COLLATE Japanese_CI_AS NULL ,
	[RawScore] [float] NULL ,
	[MaxScore] [float] NULL ,
	[MinScore] [float] NULL ,
	[status] [char] (30) COLLATE Japanese_CI_AS NULL ,
	[mastery_time] [char] (16) COLLATE Japanese_CI_AS NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Assignments] (
	[assignID] [char] (10) COLLATE Japanese_CI_AS NOT NULL ,
	[memberShipID] [char] (30) COLLATE Japanese_CI_AS NULL ,
	[materialID] [char] (20) COLLATE Japanese_CI_AS NULL ,
	[study_start_date] [datetime] NULL ,
	[enddate] [datetime] NULL ,
	[assigner] [char] (15) COLLATE Japanese_CI_AS NULL ,
	[learn_authority] [char] (1) COLLATE Japanese_CI_AS NULL ,
	[management_authority] [char] (1) COLLATE Japanese_CI_AS NULL ,
	[opening_date] [datetime] NULL ,
	[closing_date] [datetime] NULL ,
	[study_limit_cnt] [int] NULL ,
	[study_cnt] [int] NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[ConferenceLo] (
	[LOID] [char] (10) COLLATE Japanese_CI_AS NOT NULL ,
	[UrlPath] [varchar] (256) COLLATE Japanese_CI_AS NOT NULL ,
	[MeetingTitle] [varchar] (64) COLLATE Japanese_CI_AS NOT NULL ,
	[StartDate] [datetime] NOT NULL ,
	[EndDate] [datetime] NOT NULL ,
	[ResourceMail] [varchar] (128) COLLATE Japanese_CI_AS NOT NULL ,
	[LogonUser] [varchar] (128) COLLATE Japanese_CI_AS NOT NULL ,
	[w_height] [int] NOT NULL ,
	[w_width] [int] NOT NULL
) ON [PRIMARY]

CREATE TABLE [dbo].[Evaluate] (
	[user_id] [char] (8) COLLATE Japanese_CI_AS NOT NULL ,
	[LOID] [char] (10) COLLATE Japanese_CI_AS NOT NULL ,
	[score_date] [datetime] NOT NULL ,
	[score] [int] NULL ,
	[custom_msg_dir] [varchar] (256) COLLATE Japanese_CI_AS NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[ExchangeLo] (
	[LOID] [char] (10) COLLATE Japanese_CI_AS NOT NULL ,
	[UrlPath] [varchar] (256) COLLATE Japanese_CI_AS NOT NULL ,
	[w_height] [int] NOT NULL ,
	[w_width] [int] NOT NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Face2FaceLo] (
	[LOID] [char] (10) COLLATE Japanese_CI_AS NOT NULL ,
	[TeacherID] [char] (16) COLLATE Japanese_CI_AS NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[GroupAndPeople] (
	[memberShipID] [char] (30) COLLATE Japanese_CI_AS NOT NULL ,
	[sort_no] [int] DEFAULT 0 NOT NULL ,
	[parentID] [char] (15) COLLATE Japanese_CI_AS NOT NULL ,
	[childID] [char] (15) COLLATE Japanese_CI_AS NOT NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Groups] (
	[group_id] [char] (8) COLLATE Japanese_CI_AS NOT NULL ,
	[group_name] [varchar] (64) COLLATE Japanese_CI_AS NULL ,
	[group_type] [char] (4) COLLATE Japanese_CI_AS NOT NULL ,
	[delete_flag] [char] (1) COLLATE Japanese_CI_AS NULL ,
	[foreignID] [varchar] (256) COLLATE Japanese_CI_AS NULL ,
	[custom_msg_dir] [varchar] (128) COLLATE Japanese_CI_AS NULL ,
	[oid] [varchar] (256) COLLATE Japanese_CI_AS NULL ,
	[ad_dn] [varchar] (256) COLLATE Japanese_CI_AS NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[LO] (
	[LOID] [char] (10) COLLATE Japanese_CI_AS NOT NULL ,
	[LOType] [char] (3) COLLATE Japanese_CI_AS NULL ,
	[LOTitle] [varchar] (64) COLLATE Japanese_CI_AS NULL ,
	[Loexplanation] [varchar] (256) COLLATE Japanese_CI_AS NULL ,
	[foreignID] [varchar] (256) COLLATE Japanese_CI_AS NULL ,
	[KeyWord] [varchar] (256) COLLATE Japanese_CI_AS NULL ,
	[delete_flag] [char] (1) COLLATE Japanese_CI_AS NULL ,
	[LOVersion] [varchar] (10) COLLATE Japanese_CI_AS NULL ,
	[conclusion] [varchar] (1024) COLLATE Japanese_CI_AS NULL ,
	[RealLOID] [char] (10) COLLATE Japanese_CI_AS NOT NULL ,
	[Prere] [varchar] (1024) COLLATE Japanese_CI_AS NULL ,
	[MentorEmailAddress] [varchar] (256) COLLATE Japanese_CI_AS NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[LOLog] (
	[UserID] [char] (8) COLLATE Japanese_CI_AS NOT NULL ,
	[LOID] [char] (10) COLLATE Japanese_CI_AS NOT NULL ,
	[study_start_date] [datetime] NULL ,
	[residanceTime] [float] NULL ,
	[passday] [datetime] NULL ,
	[study_end_date] [datetime] NULL ,
	[highScore] [float] NULL ,
	[lowsScore] [float] NULL ,
	[execise_point] [float] NULL ,
	[fullscore] [float] NULL,
	[Access_cnt] [int] NULL,
	[last_access] [datetime] NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[LOLogSession] (
	[UserID] [char] (8) COLLATE Japanese_CI_AS NOT NULL ,
	[LOID] [char] (10) COLLATE Japanese_CI_AS NOT NULL ,
	[SessionID] [char] (128) COLLATE Japanese_CI_AS NOT NULL ,
	[study_start_date] [datetime] NULL ,
	[residanceTime] [float] NULL ,
	[passday] [datetime] NULL ,
	[study_end_date] [datetime] NULL ,
	[highScore] [float] NULL ,
	[lowsScore] [float] NULL ,
	[execise_point] [float] NULL ,
	[fullscore] [float] NULL,
	[Lunchtimes] [int] DEFAULT 0
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[LORelation] (
	[materialID] [char] (20) COLLATE Japanese_CI_AS NOT NULL ,
	[sort_no] [int] DEFAULT 0 NOT NULL ,
	[parentID] [char] (10) COLLATE Japanese_CI_AS NULL ,
	[childID] [char] (10) COLLATE Japanese_CI_AS NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[LOType] (
	[LOType] [char] (3) COLLATE Japanese_CI_AS NOT NULL ,
	[TypeName] [varchar] (64) COLLATE Japanese_CI_AS NULL ,
	[LoSubType] [char] (3) COLLATE Japanese_CI_AS NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[OfficeLo] (
	[LOID] [char] (10) COLLATE Japanese_CI_AS NOT NULL ,
	[LOUrl] [varchar] (256) COLLATE Japanese_CI_AS NULL ,
	[w_height] [int] NOT NULL ,
	[w_width] [int] NOT NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[People] (
	[user_id] [char] (8) COLLATE Japanese_CI_AS NOT NULL ,
	[user_name] [varchar] (64) COLLATE Japanese_CI_AS NULL ,
	[encrypt_password] [char] (32) COLLATE Japanese_CI_AS NULL ,
	[contact_address] [varchar] (256) COLLATE Japanese_CI_AS NULL ,
	[sex] [char] (1) COLLATE Japanese_CI_AS NULL ,
	[contact_email] [varchar] (128) COLLATE Japanese_CI_AS NULL ,
	[contact_email2] [varchar] (128) COLLATE Japanese_CI_AS NULL ,
	[reading_name] [varchar] (64) COLLATE Japanese_CI_AS NULL ,
	[birthday] [datetime] NULL ,
	[contact_tel] [char] (13) COLLATE Japanese_CI_AS NULL ,
	[custom_msg_dir] [varchar] (128) COLLATE Japanese_CI_AS NULL ,
	[delete_flag] [char] (1) COLLATE Japanese_CI_AS NULL ,
	[foreignID] [varchar] (256) COLLATE Japanese_CI_AS NULL ,
	[loginID] [varchar] (16) COLLATE Japanese_CI_AS NULL ,
	[ad_user_id] [varchar] (255) COLLATE Japanese_CI_AS NULL ,
	[user_type] [char] (4) COLLATE Japanese_CI_AS NOT NULL ,
	[oid] [varchar] (256) COLLATE Japanese_CI_AS NULL ,
	[ad_dn] [varchar] (256) COLLATE Japanese_CI_AS NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[RoleAssignments] (
	[Role_assign_id] [char] (15) COLLATE Japanese_CI_AS NOT NULL ,
	[user_id] [char] (8) COLLATE Japanese_CI_AS NULL ,
	[Role_id] [char] (10) COLLATE Japanese_CI_AS NULL ,
	[GroupID] [char] (8) COLLATE Japanese_CI_AS NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Roles] (
	[RoleID] [char] (10) COLLATE Japanese_CI_AS NOT NULL ,
	[RoleName] [varchar] (64) COLLATE Japanese_CI_AS NULL ,
	[Deleted] [char] (1) COLLATE Japanese_CI_AS NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[XmoRelation] (
	[xmo_id] [char] (15) COLLATE Japanese_CI_AS NOT NULL ,
	[related_id] [char] (15) COLLATE Japanese_CI_AS NOT NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[RolesFunction] (
	[RoleID] [char] (10) COLLATE Japanese_CI_AS NOT NULL ,
	[Function] [char] (15) COLLATE Japanese_CI_AS NOT NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[SPSLo] (
	[LOID] [char] (10) COLLATE Japanese_CI_AS NOT NULL ,
	[UrlPath] [varchar] (256) COLLATE Japanese_CI_AS NOT NULL ,
	[w_height] [int] NOT NULL ,
	[w_width] [int] NOT NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[ServerInformation] (
	[server_id] [char] (8) COLLATE Japanese_CI_AS NOT NULL ,
	[server_name] [varchar] (128) COLLATE Japanese_CI_AS NULL ,
	[ip_address] [char] (15) COLLATE Japanese_CI_AS NULL ,
	[os_kind] [char] (1) COLLATE Japanese_CI_AS NULL ,
	[server_kind] [char] (1) COLLATE Japanese_CI_AS NULL ,
	[access_account] [varchar] (32) COLLATE Japanese_CI_AS NULL ,
	[access_password] [varchar] (32) COLLATE Japanese_CI_AS NULL ,
	[proxy_server_name] [varchar] (32) COLLATE Japanese_CI_AS NULL ,
	[access_timeout] [int] NULL ,
	[http_port_number] [int] NULL ,
	[ftp_port_number] [int] NULL ,
	[protocol_kind] [int] NULL ,
	[access_type] [int] NULL ,
	[url_host_name] [varchar] (32) COLLATE Japanese_CI_AS NULL ,
	[virtual_dir_name] [varchar] (128) COLLATE Japanese_CI_AS NULL ,
	[W3S_interface] [char] (1) COLLATE Japanese_CI_AS NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[LaunchForgetLo] (
	[LOID] [char] (10) COLLATE Japanese_CI_AS NOT NULL ,
	[LOUrl] [varchar] (256) COLLATE Japanese_CI_AS NOT NULL ,
	[w_height] [int] NOT NULL ,
	[w_width] [int] NOT NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[SmartForceLo] (
	[LOID] [char] (10) COLLATE Japanese_CI_AS NOT NULL ,
	[CourseCode] [varchar] (255) COLLATE Japanese_CI_AS NOT NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[URLLo] (
	[LOID] [char] (10) COLLATE Japanese_CI_AS NOT NULL ,
	[LOUrl] [varchar] (256) COLLATE Japanese_CI_AS NOT NULL ,
	[w_height] [int] NOT NULL ,
	[w_width] [int] NOT NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[WbtLo] (
	[LOID] [char] (10) COLLATE Japanese_CI_AS NOT NULL ,
	[materialID] [varchar] (32) COLLATE Japanese_CI_AS NOT NULL ,
	[w_height] [int] NOT NULL ,
	[w_width] [int] NOT NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[XMOEntry] (
	[xmo_id] [char] (15) COLLATE Japanese_CI_AS NOT NULL ,
	[xmo_name] [varchar] (64) COLLATE Japanese_CI_AS NULL ,
	[xmo_out_line] [varchar] (100) COLLATE Japanese_CI_AS NULL ,
	[xmo_uri] [varchar] (100) COLLATE Japanese_CI_AS NULL ,
	[xmo_on_flg] [char] (1) COLLATE Japanese_CI_AS DEFAULT '1' NULL ,
	[class_name] [varchar] (256) COLLATE Japanese_CI_AS NULL ,
	[tree_view_type] [char] (1) COLLATE Japanese_CI_AS NULL ,
	[ini_menu] [varchar] (64) COLLATE Japanese_CI_AS NULL ,
	[priority] [int] NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[PerceptionLo] (
	[LOID] [char] (10) COLLATE Japanese_CI_AS NOT NULL ,
	[assessment_id] [varchar] (16) COLLATE Japanese_CI_AS NOT NULL ,
	[session_name] [char] (50) COLLATE Japanese_CI_AS NOT NULL ,
	[w_height] [int] NOT NULL ,
	[w_width] [int] NOT NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[LOHistory] (
	[LOID] [char] (10) COLLATE Japanese_CI_AS NOT NULL ,
	time_stamp [datetime] NOT NULL ,
	[UserID] [char] (8) COLLATE Japanese_CI_AS NOT NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[OL_AiccComment] (
	[UserID] [char] (8) COLLATE Japanese_CI_AS NOT NULL ,
	[LOID] [char] (10) COLLATE Japanese_CI_AS NOT NULL ,
	[SessionID] [char] (128) COLLATE Japanese_CI_AS NOT NULL ,
	[UID] [char] (255) COLLATE Japanese_CI_AS NOT NULL ,
	[course_id] [varchar] (255) COLLATE Japanese_CI_AS NULL ,
	[student_id] [char] (10) COLLATE Japanese_CI_AS NULL ,
	[lesson_id] [varchar] (255) COLLATE Japanese_CI_AS NULL ,
	[date] [datetime] NULL ,
	[time] [char] (16) COLLATE Japanese_CI_AS NULL ,
	[location] [varchar] (255) COLLATE Japanese_CI_AS NULL ,
	[comment] [varchar] (4096) COLLATE Japanese_CI_AS NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[OL_AiccCore] (
	[UserID] [char] (8) COLLATE Japanese_CI_AS NOT NULL ,
	[LOID] [char] (10) COLLATE Japanese_CI_AS NOT NULL ,
	[SessionID] [char] (128) COLLATE Japanese_CI_AS NOT NULL ,
	[UID] [char] (255) COLLATE Japanese_CI_AS NOT NULL ,
	[Lesson_Status] [varchar] (30) COLLATE Japanese_CI_AS NULL ,
	[RawScore] [float] NULL ,
	[MaxScore] [float] NULL ,
	[MinScore] [float] NULL ,
	[Time] [char] (16) COLLATE Japanese_CI_AS NULL ,
	[Lesson_Location] [varchar] (255) COLLATE Japanese_CI_AS NULL ,
	[exist] [char] (10) COLLATE Japanese_CI_AS NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[OL_AiccInteraction] (
	[UserID] [char] (8) COLLATE Japanese_CI_AS NOT NULL ,
	[LOID] [char] (10) COLLATE Japanese_CI_AS NOT NULL ,
	[SessionID] [char] (128) COLLATE Japanese_CI_AS NOT NULL ,
	[UID] [char] (255) COLLATE Japanese_CI_AS NOT NULL ,
	[course_id] [varchar] (255) COLLATE Japanese_CI_AS NULL ,
	[student_id] [char] (10) COLLATE Japanese_CI_AS NULL ,
	[lesson_id] [varchar] (255) COLLATE Japanese_CI_AS NULL ,
	[response_times] [int] NOT NULL ,
	[date] [datetime] NULL ,
	[time] [char] (16) COLLATE Japanese_CI_AS NULL ,
	[interaction_id] [varchar] (255) COLLATE Japanese_CI_AS NULL ,
	[objective_id] [varchar] (255) COLLATE Japanese_CI_AS NULL ,
	[type_interaction] [char] (30) COLLATE Japanese_CI_AS NULL ,
	[correct_response] [varchar] (4096) COLLATE Japanese_CI_AS NULL ,
	[response_value] [char] (30) COLLATE Japanese_CI_AS NULL ,
	[student_response] [varchar] (255) COLLATE Japanese_CI_AS NULL ,
	[result] [char] (30) COLLATE Japanese_CI_AS NULL ,
	[weighting] [float] NULL ,
	[latency] [char] (16) COLLATE Japanese_CI_AS NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[OL_AiccObjectives] (
	[UserID] [char] (8) COLLATE Japanese_CI_AS NOT NULL ,
	[LOID] [char] (10) COLLATE Japanese_CI_AS NOT NULL ,
	[SessionID] [char] (128) COLLATE Japanese_CI_AS NOT NULL ,
	[UID] [char] (255) COLLATE Japanese_CI_AS NOT NULL ,
	[course_id] [varchar] (255) COLLATE Japanese_CI_AS NULL ,
	[student_id] [char] (10) COLLATE Japanese_CI_AS NULL ,
	[lesson_id] [varchar] (255) COLLATE Japanese_CI_AS NULL ,
	[date] [datetime] NULL ,
	[time] [char] (16) COLLATE Japanese_CI_AS NULL ,
	[objective_id] [varchar] (255) COLLATE Japanese_CI_AS NULL ,
	[RawScore] [float] NULL ,
	[MaxScore] [float] NULL ,
	[MinScore] [float] NULL ,
	[status] [char] (30) COLLATE Japanese_CI_AS NULL ,
	[mastery_time] [char] (16) COLLATE Japanese_CI_AS NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[OL_SectionLog] (
	[UserID] [char] (8) COLLATE Japanese_CI_AS NOT NULL ,
	[LOID] [char] (10) COLLATE Japanese_CI_AS NOT NULL ,
	[SessionID] [char] (128) COLLATE Japanese_CI_AS NOT NULL ,
	[UID] [char] (255) COLLATE Japanese_CI_AS NOT NULL ,
	[Lesson_Status] [varchar] (30) COLLATE Japanese_CI_AS NULL ,
	[Time] [char] (16) COLLATE Japanese_CI_AS NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[OfflineLo] (
	[LOID] [char] (10) COLLATE Japanese_CI_AS NOT NULL ,
	[materialID] [varchar] (32) COLLATE Japanese_CI_AS NOT NULL ,
	[w_height] [int] NOT NULL ,
	[w_width] [int] NOT NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[CatalogLo] (
	[LOID] [char] (10) COLLATE Japanese_CI_AS NOT NULL ,
	[w_height] [int] NOT NULL ,
	[w_width] [int] NOT NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[CatalogLo_LoList] (
	[LOID] [char] (10) COLLATE Japanese_CI_AS NOT NULL ,
	[CatalogListLOID] [char] (10) COLLATE Japanese_CI_AS NOT NULL ,
	[sort_no] [int] NOT NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[prerequisite] (
	[LOID] [char] (10) COLLATE Japanese_CI_AS NULL ,
	[PrereID] [char] (10) COLLATE Japanese_CI_AS NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[ScormLo] (
	[LOID] [char] (10) COLLATE Japanese_CI_AS NOT NULL ,
	[materialID] [varchar] (32) COLLATE Japanese_CI_AS NOT NULL ,
	[w_height] [int] NOT NULL ,
	[w_width] [int] NOT NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[ScormSession] (
	[UserID] [char] (8) COLLATE Japanese_CI_AS NOT NULL ,
	[LOID] [char] (10) COLLATE Japanese_CI_AS NOT NULL ,
	[StudySessionCount] [int] NOT NULL ,
	[SessionID] [char] (128) COLLATE Japanese_CI_AS NOT NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Scorm_Attempt] (
	[UserID] [char] (8) COLLATE Japanese_CI_AS NOT NULL ,
	[LOID] [char] (10) COLLATE Japanese_CI_AS NOT NULL ,
	[StudySessionCount] [int] NOT NULL ,
	[ActivityID] [char] (255) COLLATE Japanese_CI_AS NOT NULL ,
	[AttemptCount] [int] NOT NULL ,
	[LearnSessionCount] [int] NOT NULL ,
	[SessionID] [char] (128) COLLATE Japanese_CI_AS NOT NULL ,
	[LearnSession_Date] [datetime] NOT NULL ,
	[Completion_Status] [varchar] (30) COLLATE Japanese_CI_AS NULL ,
	[ScaledScore] [float] NULL ,
	[RawScore] [float] NULL ,
	[MaxScore] [float] NULL ,
	[MinScore] [float] NULL ,
	[Attempt_Session_Time] [float] NULL ,
	[Success_Status] [varchar] (30) COLLATE Japanese_CI_AS NULL ,
	[Location] [varchar] (1000) COLLATE Japanese_CI_AS NULL ,
	[Exit] [varchar] (10) COLLATE Japanese_CI_AS NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Scorm_Interaction] (
	[UserID] [char] (8) COLLATE Japanese_CI_AS NOT NULL ,
	[LOID] [char] (10) COLLATE Japanese_CI_AS NOT NULL ,
	[StudySessionCount] [int] NOT NULL ,
	[ActivityID] [char] (255) COLLATE Japanese_CI_AS NOT NULL ,
	[AttemptCount] [int] NOT NULL ,
	[LearnSessionCount] [int] NOT NULL ,
	[InteractionCount] [int] NOT NULL ,
	[SessionID] [char] (128) COLLATE Japanese_CI_AS NOT NULL ,
	[InteractionID] [varchar] (510) COLLATE Japanese_CI_AS NULL ,
	[InteractionType] [varchar] (30) COLLATE Japanese_CI_AS NULL ,
	[ObjectiveId] [varchar] (4096) COLLATE Japanese_CI_AS NULL ,
	[Timestamp] [datetime] NULL ,
	[CorrectResponse1] [varchar] (510) COLLATE Japanese_CI_AS NULL ,
	[CorrectResponse2] [varchar] (510) COLLATE Japanese_CI_AS NULL ,
	[CorrectResponse3] [varchar] (510) COLLATE Japanese_CI_AS NULL ,
	[CorrectResponse4] [varchar] (510) COLLATE Japanese_CI_AS NULL ,
	[CorrectResponse5] [varchar] (510) COLLATE Japanese_CI_AS NULL ,
	[Weighting] [float] NULL ,
	[LearnerResponse] [varchar] (510) COLLATE Japanese_CI_AS NULL ,
	[Learner_Result] [varchar] (30) COLLATE Japanese_CI_AS NULL ,
	[Latency] [float] NULL ,
	[Description] [varchar] (255) COLLATE Japanese_CI_AS NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Scorm_LMSComment] (
	[UserID] [char] (8) COLLATE Japanese_CI_AS NOT NULL ,
	[LOID] [char] (10) COLLATE Japanese_CI_AS NOT NULL ,
	[StudySessionCount] [int] NOT NULL ,
	[ActivityID] [char] (255) COLLATE Japanese_CI_AS NOT NULL ,
	[AttemptCount] [int] NOT NULL ,
	[LearnSessionCount] [int] NOT NULL ,
	[LMSCommentCount] [int] NOT NULL ,
	[SessionID] [char] (128) COLLATE Japanese_CI_AS NOT NULL ,
	[LMSComment] [varchar] (4096) COLLATE Japanese_CI_AS NULL ,
	[LMSCommentLocation] [varchar] (255) COLLATE Japanese_CI_AS NULL ,
	[LMSCommentTime] [varchar] (255) COLLATE Japanese_CI_AS NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Scorm_LearnerComment] (
	[UserID] [char] (8) COLLATE Japanese_CI_AS NOT NULL ,
	[LOID] [char] (10) COLLATE Japanese_CI_AS NOT NULL ,
	[StudySessionCount] [int] NOT NULL ,
	[ActivityID] [char] (255) COLLATE Japanese_CI_AS NOT NULL ,
	[AttemptCount] [int] NOT NULL ,
	[LearnSessionCount] [int] NOT NULL ,
	[LearnerCommentCount] [int] NOT NULL ,
	[SessionID] [char] (128) COLLATE Japanese_CI_AS NOT NULL ,
	[LearnerComment] [varchar] (4096) COLLATE Japanese_CI_AS NULL ,
	[LearnerCommentLocation] [varchar] (255) COLLATE Japanese_CI_AS NULL ,
	[LearnerCommentTime] [varchar] (255) COLLATE Japanese_CI_AS NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Scorm_Objective] (
	[UserID] [char] (8) COLLATE Japanese_CI_AS NOT NULL ,
	[LOID] [char] (10) COLLATE Japanese_CI_AS NOT NULL ,
	[StudySessionCount] [int] NOT NULL ,
	[ActivityID] [char] (255) COLLATE Japanese_CI_AS NOT NULL ,
	[AttemptCount] [int] NOT NULL ,
	[LearnSessionCount] [int] NOT NULL ,
	[ObjectiveCount] [int] NOT NULL ,
	[SessionID] [char] (128) COLLATE Japanese_CI_AS NOT NULL ,
	[ObjectiveId] [varchar] (4096) COLLATE Japanese_CI_AS NULL ,
	[ScaledScore] [float] NULL ,
	[RawScore] [float] NULL ,
	[MaxScore] [float] NULL ,
	[MinScore] [float] NULL ,
	[SuccessStatus] [varchar] (30) COLLATE Japanese_CI_AS NULL ,
	[CompletionStatus] [varchar] (30) COLLATE Japanese_CI_AS NULL
) ON [PRIMARY]
GO

