张家口4中
alter table ac_answer_stand add card_type char(1)
alter table ac_stud_answer1 add card_type char(1)
alter table ac_current_score alter column exam_code varchar(15)
alter table ac_history_score alter column exam_code varchar(15)
alter table ac_stud_allscore alter column exam_code varchar(15)
alter table ac_stud_answer1 alter column exam_code varchar(15)
alter table ac_stud_answer2 alter column exam_code varchar(15)
alter table ac_stud_score1 alter column exam_code varchar(15)
alter table ac_stud_score2 alter column exam_code varchar(15)
alter table xj_student_info alter column exam_code varchar(15)
---教师评估教师认班级列表数原来是10个班，现在可以50个班---
alter table eva_teacher_list alter column class_code varchar(100)
邢台：
学籍：xj_student_info  add if_stat char(1)
教师评估：增加表：eva_class_teacher
网上权限：xj_teacher add teacher_code varchar(10)  主健
          增加表：xj_teacher_class
                  (teacher_code varchar(10),
                   grade_code   varchar(4),
                   group_name   varchar(20),
                   class_code   varchar(6),
                   course_name  varchar(30),
                   )
新生入学：xj_new_student_info   add  score7 numeric(5,1)

script:
alter TABLE xj_new_student_info add score7 [numeric] (5,1) NULL
alter TABLE xj_student_info add if_stat [char] (1) NULL
alter TABLE xj_teacher add teacher_code [varchar] (10) NULL

CREATE TABLE [dbo].[eva_class_teacher] (
	[grade_code] [varchar] (4)  NULL ,
	[class_code] [varchar] (6)  NULL ,
	[id] [varchar] (4)  NOT NULL ,
	[teacher_name] [varchar] (20)  NULL ,
	[course_name] [varchar] (10)  NULL 
) ON [PRIMARY]

CREATE TABLE [dbo].[xj_teacher_class] (
        [teacher_id] [int] IDENTITY (1, 1) NOT NULL , --注意此项二中没有变--
	[teacher_code] [varchar] (10) NOT NULL ,
	[grade_code] [varchar] (4) NULL ,
	[group_name] [varchar] (20) NULL ,
	[class_code] [varchar] (6) NULL ,
	[course_name] [varchar] (30) NULL 
) ON [PRIMARY]
GO

delete from xj_teacher
delete from xj_teacher_class

insert into xj_teacher (teacher_code,pass,teacher_name,[right])
select [id],[id],teacher_name,'任课教师' from eva_teacher_list
insert into xj_teacher_class (teacher_code,grade_code,class_code,course_name)
select [id],grade_code,class_code,course_name from eva_class_teacher
go
--20041105---
CREATE TABLE [dbo].[eva_teacher_sumscore] ( 
[id] [varchar] (4) NOT NULL ,
[teacher_name] [varchar] (10) NULL ,
[course_name] [varchar] (10) NULL ,
[grade_code] [varchar] (4) NULL ,
[class_code] [varchar] (50) NULL ,
[a1] [numeric](7, 3) NULL ,
[a2] [numeric](7, 3) NULL ,
[a3] [numeric](7, 3) NULL ,
[a4] [numeric](7, 3) NULL ,
[a5] [numeric](7, 3) NULL ,
[a6] [numeric](7, 3) NULL ,
[a7] [numeric](7, 3) NULL ,
[a8] [numeric](7, 3) NULL ,
[a9] [numeric](7, 3) NULL ,
[a10] [numeric](7, 3) NULL ,
[a11] [numeric](7, 3) NULL ,
[a12] [numeric](7, 3) NULL ,
[a13] [numeric](7, 3) NULL ,
[a14] [numeric](7, 3) NULL ,
[a15] [numeric](7, 3) NULL ,
[all_score] [numeric](7, 3) NULL ,
[all_score_zf] [numeric](7, 3) NULL ,
[grade_avg_score] [numeric](7, 3) NULL ,
[school_avg_score] [numeric](7, 3) NULL ,
[grade_place] [int] NULL ,
[school_place] [int] NULL ,
[grade_prs_num] [int] NULL ,
[school_prs_num] [int] NULL 
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[ac_stud_answer_analyse_for5y] ( 
[grade_code] [varchar] (4) NULL ,
[course_name] [varchar] (8) NULL ,
[term] [varchar] (12) NULL ,
[group_name] [varchar] (20) NULL ,
[prob_code] [int] NULL ,
[prob_type] [varchar] (12) NULL ,
[prob_answer] [varchar] (8) NULL ,
[answ_a] [int] NULL ,
[answ_b] [int] NULL ,
[answ_c] [int] NULL ,
[answ_d] [int] NULL ,
[answ_e] [int] NULL ,
[answ_p] [int] NULL ,
[answ_q] [int] NULL ,
[answ_r] [int] NULL ,
[answ_s] [int] NULL ,
[answ_t] [int] NULL ,
[answ_u] [int] NULL ,
[answ_v] [int] NULL ,
[answ_1] [int] NULL ,
[answ_2] [int] NULL ,
[answ_3] [int] NULL ,
[answ_4] [int] NULL ,
[answ_5] [int] NULL ,
[answ_6] [int] NULL ,
[answ_7] [int] NULL ,
[answ_8] [int] NULL ,
[answ_9] [int] NULL ,
[answ_10] [int] NULL ,
[answ_11] [int] NULL ,
[answ_12] [int] NULL ,
[answ_13] [int] NULL ,
[answ_14] [int] NULL ,
[answ_15] [int] NULL ,
[answ_16] [int] NULL ,
[answ_17] [int] NULL ,
[answ_18] [int] NULL ,
[answ_19] [int] NULL ,
[answ_20] [int] NULL ,
[answ_21] [int] NULL ,
[answ_22] [int] NULL ,
[answ_23] [int] NULL ,
[answ_24] [int] NULL ,
[answ_25] [int] NULL ,
[answ_26] [int] NULL ,
[answ_27] [int] NULL ,
[answ_28] [int] NULL ,
[answ_29] [int] NULL ,
[answ_30] [int] NULL ,
[answ_31] [int] NULL ,
[answ_32] [int] NULL ,
[answ_33] [int] NULL ,
[answ_34] [int] NULL ,
[answ_35] [int] NULL ,
[answ_36] [int] NULL ,
[answ_37] [int] NULL ,
[answ_38] [int] NULL ,
[answ_39] [int] NULL ,
[answ_40] [int] NULL ,
[answ_41] [int] NULL ,
[answ_42] [int] NULL ,
[answ_43] [int] NULL ,
[answ_44] [int] NULL ,
[answ_45] [int] NULL ,
[answ_allright] [int] NULL ,
[answ_part] [int] NULL ,
[bool_answ_part] [varchar] (1) NULL ,
[per_answ_allright] [numeric](5, 2) NULL ,
[per_answ_isscore] [numeric](5, 2) NULL 
) ON [PRIMARY]

GO

CREATE PROCEDURE [dbo].[PROC_teacher_pg] 
@v_grade_code varchar(4)
AS
declare @v_course_name varchar (20)
DECLARE cur_course_name CURSOR FOR
select distinct course_name from eva_teacher_list where grade_code=@v_grade_code and course_name<>'班主任'

delete from eva_score_stand where grade_code=@v_grade_code and course_name<>'班主任'
OPEN cur_course_name

FETCH NEXT FROM cur_course_name into @v_course_name
--insert into eva_score_stand  (id,item_name,grade_code,course_name,score) select id,item_name,@v_grade_code,@v_course_name,score from eva_score_model

WHILE @@FETCH_STATUS = 0
BEGIN
	insert into eva_score_stand  (id,item_name,grade_code,course_name,score) select id,item_name,@v_grade_code,@v_course_name,score from eva_score_model
	FETCH NEXT FROM cur_course_name into @v_course_name
END

CLOSE cur_course_name
DEALLOCATE cur_course_name
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[PROC_graduate]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[PROC_graduate]
GO

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

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

CREATE PROCEDURE [dbo].[PROC_graduate]  
@grade_code varchar (4), 
@v_datetime varchar (10) 
AS 
DECLARE @v_temp_table varchar(30) 
declare @v_str_update varchar (300) 
DECLARE mycursor CURSOR FOR 
select temp_table1 from ac_exam_list where temp_table1 is not null and temp_table1 <> '' 
delete from xj_grade_info where grade_code=@grade_code 
delete from xj_class_info where grade_code=@grade_code 
delete from ac_class where grade_code=@grade_code 
delete from ac_course_teacher where grade_code=@grade_code 
insert into xj_grad_stud_info( stud_archive,stud_name,grade_code,class_code,class_name, 
stud_code,stud_status, 
stud_nation,stud_polvis,stud_sex,stud_incorp_time,stud_birth,all_score,stud_origin, 
stud_enter_time,stud_home_address,stud_tel,stud_native,stud_register,stud_reg_adress, 
stud_kind_1,stud_kind_2,stud_kind_3,flag_switchin,stud_father,stud_father_unit, 
stud_father_duty,stud_father_unittel,stud_monther,stud_monther_unit,stud_monther_duty, 
stud_monther_unittel,stud_grad_date,group_name)  
 select stud_archive,stud_name,grade_code,class_code,class_name, 
stud_code,stud_status, 
stud_nation,stud_polvis,stud_sex,stud_incorp_time,stud_birth,all_score,stud_origin, 
stud_enter_time,stud_home_address,stud_tel,stud_native,stud_register,stud_reg_adress, 
stud_kind_1,stud_kind_2,stud_kind_3,flag_switchin,stud_father,stud_father_unit, 
stud_father_duty,stud_father_unittel,stud_monther,stud_monther_unit,stud_monther_duty, 
stud_monther_unittel,@v_datetime,group_name 
  from xj_student_info where grade_code=@grade_code 
delete  from xj_student_info where grade_code=@grade_code 
insert into ac_history_score(exam_id,grade_code,class_code,exam_type, 
exam_time,stud_year,term,course_name, 
stud_name,stud_code,stud_status, 
stud_archive,bool_absence,exam_code, 
bool_formal,score1,score2,exam_score,stud_leave_time ) 
 select exam_id,grade_code,class_code,exam_type, 
exam_time,stud_year,term,course_name, 
stud_name,stud_code,stud_status, 
stud_archive,bool_absence,exam_code, 
bool_formal,score1,score2,exam_score,@v_datetime 
 from ac_current_score where grade_code=@grade_code 
delete from ac_current_score where grade_code=@grade_code 
insert into ac_exam_his_list(exam_id,stud_leave_time,grade_code,exam_type, 
exam_time,stud_year,term,group_name)  
 select exam_id,@v_datetime,grade_code,exam_type,exam_time,stud_year,term,group_name  
 from ac_exam_list where grade_code=@grade_code 
delete from ac_exam_list where grade_code=@grade_code 
delete from ac_exam_place where grade_code=@grade_code 
OPEN mycursor 
FETCH NEXT FROM mycursor into @v_temp_table 
WHILE @@FETCH_STATUS = 0 
BEGIN 
	if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].['+@v_temp_table+']') and OBJECTPROPERTY(id, N'IsUserTable') = 1) 
	begin 
	  set @v_str_update='drop  table '+@v_temp_table 
	  execute @v_str_update 
	end 
	FETCH NEXT FROM mycursor into @v_temp_table 
END 
CLOSE mycursor 
DEALLOCATE mycursor 

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO


CREATE PROCEDURE [dbo].[PROC_upgrade] 
AS 
DECLARE @v_temp_table varchar(30) 
declare @v_str_update varchar (300) 
DECLARE mycursor CURSOR FOR 
select temp_table1 from ac_exam_list where temp_table1 is not null and temp_table1 <> '' 
update xj_student_info set grade_code=left(grade_code,3)+right(substring(grade_code,4,1)+1,1),class_code=left(class_code,3)+right(substring(class_code,4,1)+1,1)+substring(class_code,5,2),stud_code=left(stud_code,3)+right(substring(stud_code,4,1)+1,1)+substring(stud_code,5,4) 
update xj_student_info set class_name='初中'+substring(grade_code,4,1) +'年级' +substring(class_code,5,2) + '班'  where grade_code like '01%' 
update xj_student_info set class_name='高中'+substring(grade_code,4,1) +'年级' +substring(class_code,5,2) + '班' where grade_code like '02%' 
update xj_grade_info set grade_code=left(grade_code,3)+right(substring(grade_code,4,1)+1,1) 
update xj_grade_info set  grade_name='初中'+substring(grade_code,4,1) +'年级' where grade_code like '01%' 
update xj_grade_info set  grade_name='初中'+substring(grade_code,4,1) +'年级' where grade_code like '01%' 
update xj_class_info set grade_code=left(grade_code,3)+right(substring(grade_code,4,1)+1,1),class_code=left(class_code,3)+right(substring(class_code,4,1)+1,1)+substring(class_code,5,2) 
update xj_class_info set class_name='初中'+substring(grade_code,4,1) +'年级' +substring(class_code,5,2) + '班' where grade_code like '01%' 
update xj_class_info set class_name='高中'+substring(grade_code,4,1) +'年级' +substring(class_code,5,2) + '班' where grade_code like '02%' 
update ac_class set grade_code=left(grade_code,3)+right(substring(grade_code,4,1)+1,1),class_code=left(class_code,3)+right(substring(class_code,4,1)+1,1)+substring(class_code,5,2) 
update ac_class set class_name='初中'+substring(grade_code,4,1) +'年级' +substring(class_code,5,2) + '班' where grade_code like '01%' 
update ac_class set class_name='高中'+substring(grade_code,4,1) +'年级' +substring(class_code,5,2) + '班' where grade_code like '02%' 
update ac_current_score set grade_code=left(grade_code,3)+right(substring(grade_code,4,1)+1,1),class_code=left(class_code,3)+right(substring(class_code,4,1)+1,1)+substring(class_code,5,2),stud_code=left(stud_code,3)+right(substring(stud_code,4,1)+1,1)+substring(stud_code,5,4) 
update ac_exam_list set grade_code=left(grade_code,3)+right(substring(grade_code,4,1)+1,1) 
update ac_course_teacher set grade_code=left(grade_code,3)+right(substring(grade_code,4,1)+1,1),class_code=left(class_code,3)+right(substring(class_code,4,1)+1,1)+substring(class_code,5,2) 
update ac_grade_group set grade_code=left(grade_code,3)+right(substring(grade_code,4,1)+1,1) 
OPEN mycursor 
FETCH NEXT FROM mycursor into @v_temp_table 
WHILE @@FETCH_STATUS = 0 
BEGIN 
	if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].['+@v_temp_table+']') and OBJECTPROPERTY(id, N'IsUserTable') = 1) 
	begin 
	  set @v_str_update='update '+@v_temp_table+' set class_code=left(class_code,3)+right(substring(class_code,4,1)+1,1)+substring(class_code,5,2),stud_code=left(stud_code,3)+right(substring(stud_code,4,1)+1,1)+substring(stud_code,5,4)' 
	  execute @v_str_update 
	end 
	FETCH NEXT FROM mycursor into @v_temp_table 
END 
CLOSE mycursor 
DEALLOCATE mycursor 

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO


--20041212------
alter TABLE pub_operator add [level] [char] (1) NULL
go
update pub_operator set [level]='1'
go

----20041214---
alter table eva_read_answer alter column [result_1] [varchar] (50) NULL
alter table eva_read_answer alter column [result_2] [varchar] (500) NULL

----20041221---
alter TABLE eva_read_score add 	[x16a] [int] NULL 
alter TABLE eva_read_score add 	[x16b] [int] NULL 
alter TABLE eva_read_score add 	[x16c] [int] NULL 
alter TABLE eva_read_score add 	[x16d] [int] NULL 
alter TABLE eva_read_score add 	[x17a] [int] NULL 
alter TABLE eva_read_score add 	[x17b] [int] NULL 
alter TABLE eva_read_score add 	[x17c] [int] NULL 
alter TABLE eva_read_score add 	[x17d] [int] NULL 
alter TABLE eva_read_score add 	[x18a] [int] NULL 
alter TABLE eva_read_score add 	[x18b] [int] NULL 
alter TABLE eva_read_score add 	[x18c] [int] NULL 
alter TABLE eva_read_score add 	[x18d] [int] NULL 
alter TABLE eva_read_score add 	[x19a] [int] NULL 
alter TABLE eva_read_score add 	[x19b] [int] NULL 
alter TABLE eva_read_score add 	[x19c] [int] NULL 
alter TABLE eva_read_score add 	[x19d] [int] NULL 
alter TABLE eva_read_score add 	[x20a] [int] NULL 
alter TABLE eva_read_score add 	[x20b] [int] NULL 
alter TABLE eva_read_score add 	[x20c] [int] NULL 
alter TABLE eva_read_score add 	[x20d] [int] NULL 

alter TABLE eva_teacher_score add [a16] [numeric](7, 3) NULL
alter TABLE eva_teacher_score add [a17] [numeric](7, 3) NULL
alter TABLE eva_teacher_score add [a18] [numeric](7, 3) NULL
alter TABLE eva_teacher_score add [a19] [numeric](7, 3) NULL
alter TABLE eva_teacher_score add [a20] [numeric](7, 3) NULL

alter TABLE eva_teacher_sumscore add [a16] [numeric](7, 3) NULL
alter TABLE eva_teacher_sumscore add [a17] [numeric](7, 3) NULL
alter TABLE eva_teacher_sumscore add [a18] [numeric](7, 3) NULL
alter TABLE eva_teacher_sumscore add [a19] [numeric](7, 3) NULL
alter TABLE eva_teacher_sumscore add [a20] [numeric](7, 3) NULL

--20050115----增加部分项目和，易于统一比较
alter TABLE eva_teacher_score add [part_score] [numeric](7, 3) NULL
alter TABLE eva_teacher_sumscore add [part_score] [numeric](7, 3) NULL
--20050117---增加每一项目总人数，方便求百分比
alter TABLE eva_read_score add 	[x1] [int] NULL 
alter TABLE eva_read_score add 	[x2] [int] NULL 
alter TABLE eva_read_score add 	[x3] [int] NULL 
alter TABLE eva_read_score add 	[x4] [int] NULL 
alter TABLE eva_read_score add 	[x5] [int] NULL 
alter TABLE eva_read_score add 	[x6] [int] NULL 
alter TABLE eva_read_score add 	[x7] [int] NULL 
alter TABLE eva_read_score add 	[x8] [int] NULL 
alter TABLE eva_read_score add 	[x9] [int] NULL 
alter TABLE eva_read_score add 	[x10] [int] NULL 
alter TABLE eva_read_score add 	[x11] [int] NULL 
alter TABLE eva_read_score add 	[x12] [int] NULL 
alter TABLE eva_read_score add 	[x13] [int] NULL 
alter TABLE eva_read_score add 	[x14] [int] NULL 
alter TABLE eva_read_score add 	[x15] [int] NULL 
alter TABLE eva_read_score add 	[x16] [int] NULL 
alter TABLE eva_read_score add 	[x17] [int] NULL 
alter TABLE eva_read_score add 	[x18] [int] NULL 
alter TABLE eva_read_score add 	[x19] [int] NULL 
alter TABLE eva_read_score add 	[x20] [int] NULL 
alter TABLE eva_read_score add [part_score] [int] NULL

CREATE TABLE [dbo].[eva_read_sumscore] (
	[id] [varchar] (4) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[teacher_name] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[course_name] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[grade_code] [varchar] (4) COLLATE Chinese_PRC_CI_AS NULL ,
	[class_code] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[x1a] [int] NULL ,
	[x1b] [int] NULL ,
	[x1c] [int] NULL ,
	[x1d] [int] NULL ,
	[x2a] [int] NULL ,
	[x2b] [int] NULL ,
	[x2c] [int] NULL ,
	[x2d] [int] NULL ,
	[x3a] [int] NULL ,
	[x3b] [int] NULL ,
	[x3c] [int] NULL ,
	[x3d] [int] NULL ,
	[x4a] [int] NULL ,
	[x4b] [int] NULL ,
	[x4c] [int] NULL ,
	[x4d] [int] NULL ,
	[x5a] [int] NULL ,
	[x5b] [int] NULL ,
	[x5c] [int] NULL ,
	[x5d] [int] NULL ,
	[x6a] [int] NULL ,
	[x6b] [int] NULL ,
	[x6c] [int] NULL ,
	[x6d] [int] NULL ,
	[x7a] [int] NULL ,
	[x7b] [int] NULL ,
	[x7c] [int] NULL ,
	[x7d] [int] NULL ,
	[x8a] [int] NULL ,
	[x8b] [int] NULL ,
	[x8c] [int] NULL ,
	[x8d] [int] NULL ,
	[x9a] [int] NULL ,
	[x9b] [int] NULL ,
	[x9c] [int] NULL ,
	[x9d] [int] NULL ,
	[x10a] [int] NULL ,
	[x10b] [int] NULL ,
	[x10c] [int] NULL ,
	[x10d] [int] NULL ,
	[x11a] [int] NULL ,
	[x11b] [int] NULL ,
	[x11c] [int] NULL ,
	[x11d] [int] NULL ,
	[x12a] [int] NULL ,
	[x12b] [int] NULL ,
	[x12c] [int] NULL ,
	[x12d] [int] NULL ,
	[x13a] [int] NULL ,
	[x13b] [int] NULL ,
	[x13c] [int] NULL ,
	[x13d] [int] NULL ,
	[x14a] [int] NULL ,
	[x14b] [int] NULL ,
	[x14c] [int] NULL ,
	[x14d] [int] NULL ,
	[x15a] [int] NULL ,
	[x15b] [int] NULL ,
	[x15c] [int] NULL ,
	[x15d] [int] NULL ,
	[x16a] [int] NULL ,
	[x16b] [int] NULL ,
	[x16c] [int] NULL ,
	[x16d] [int] NULL ,
	[x17a] [int] NULL ,
	[x17b] [int] NULL ,
	[x17c] [int] NULL ,
	[x17d] [int] NULL ,
	[x18a] [int] NULL ,
	[x18b] [int] NULL ,
	[x18c] [int] NULL ,
	[x18d] [int] NULL ,
	[x19a] [int] NULL ,
	[x19b] [int] NULL ,
	[x19c] [int] NULL ,
	[x19d] [int] NULL ,
	[x20a] [int] NULL ,
	[x20b] [int] NULL ,
	[x20c] [int] NULL ,
	[x20d] [int] NULL ,
	[all_score] [int] NULL ,
	[end1] [numeric](7, 3) NULL ,
	[end2] [numeric](7, 3) NULL ,
	[x1] [int] NULL ,
	[x2] [int] NULL ,
	[x3] [int] NULL ,
	[x4] [int] NULL ,
	[x5] [int] NULL ,
	[x6] [int] NULL ,
	[x7] [int] NULL ,
	[x8] [int] NULL ,
	[x9] [int] NULL ,
	[x10] [int] NULL ,
	[x11] [int] NULL ,
	[x12] [int] NULL ,
	[x13] [int] NULL ,
	[x14] [int] NULL ,
	[x15] [int] NULL ,
	[x16] [int] NULL ,
	[x17] [int] NULL ,
	[x18] [int] NULL ,
	[x19] [int] NULL ,
	[x20] [int] NULL ,
	[part_score] [int] NULL 
) ON [PRIMARY]
GO
----20050127--------脚本控制
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UpdateRecord]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[UpdateRecord]
GO

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

CREATE TABLE [dbo].[UpdateRecord] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[Version] [varchar] (50) NULL ,
	[UpdateDate] [varchar] (50) NULL ,
	[UpdateDesc] [varchar] (200) NULL ,
	[Slove] [varchar] (50) NULL ,
	[ScriptFileName] [varchar] (50) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Version] (
	[Version] [varchar] (50) NULL 
) ON [PRIMARY]
GO
CREATE VIEW dbo.VTeacherScore 
 AS 
 SELECT dbo.eva_teacher_sumscore.*, dbo.eva_read_sumscore.x1a, 
      dbo.eva_read_sumscore.x1b, dbo.eva_read_sumscore.x1c, 
      dbo.eva_read_sumscore.x1d, dbo.eva_read_sumscore.x2a, 
      dbo.eva_read_sumscore.x2b, dbo.eva_read_sumscore.x2c, 
      dbo.eva_read_sumscore.x2d, dbo.eva_read_sumscore.x3a, 
      dbo.eva_read_sumscore.x3b, dbo.eva_read_sumscore.x3c, 
      dbo.eva_read_sumscore.x3d, dbo.eva_read_sumscore.x4a, 
      dbo.eva_read_sumscore.x4b, dbo.eva_read_sumscore.x4c, 
      dbo.eva_read_sumscore.x4d, dbo.eva_read_sumscore.x5a, 
      dbo.eva_read_sumscore.x5b, dbo.eva_read_sumscore.x5c, 
      dbo.eva_read_sumscore.x5d, dbo.eva_read_sumscore.x6a, 
      dbo.eva_read_sumscore.x6b, dbo.eva_read_sumscore.x6c, 
      dbo.eva_read_sumscore.x6d, dbo.eva_read_sumscore.x7a, 
      dbo.eva_read_sumscore.x7b, dbo.eva_read_sumscore.x7c, 
      dbo.eva_read_sumscore.x7d, dbo.eva_read_sumscore.x8a, 
      dbo.eva_read_sumscore.x8b, dbo.eva_read_sumscore.x8c, 
      dbo.eva_read_sumscore.x8d, dbo.eva_read_sumscore.x9a, 
      dbo.eva_read_sumscore.x9b, dbo.eva_read_sumscore.x9c, 
      dbo.eva_read_sumscore.x9d, dbo.eva_read_sumscore.x10a, 
      dbo.eva_read_sumscore.x10b, dbo.eva_read_sumscore.x10c, 
      dbo.eva_read_sumscore.x10d, dbo.eva_read_sumscore.x11a, 
      dbo.eva_read_sumscore.x11b, dbo.eva_read_sumscore.x11c, 
      dbo.eva_read_sumscore.x11d, dbo.eva_read_sumscore.x12a, 
      dbo.eva_read_sumscore.x12b, dbo.eva_read_sumscore.x12c, 
      dbo.eva_read_sumscore.x12d, dbo.eva_read_sumscore.x13a, 
      dbo.eva_read_sumscore.x13b, dbo.eva_read_sumscore.x13c, 
      dbo.eva_read_sumscore.x13d, dbo.eva_read_sumscore.x14a, 
      dbo.eva_read_sumscore.x14b, dbo.eva_read_sumscore.x14c, 
      dbo.eva_read_sumscore.x14d, dbo.eva_read_sumscore.x15a, 
      dbo.eva_read_sumscore.x15b, dbo.eva_read_sumscore.x15c, 
      dbo.eva_read_sumscore.x15d, dbo.eva_read_sumscore.x16a, 
      dbo.eva_read_sumscore.x16b, dbo.eva_read_sumscore.x16c, 
      dbo.eva_read_sumscore.x16d, dbo.eva_read_sumscore.x17a, 
      dbo.eva_read_sumscore.x17b, dbo.eva_read_sumscore.x17c, 
      dbo.eva_read_sumscore.x17d, dbo.eva_read_sumscore.x18a, 
      dbo.eva_read_sumscore.x18b, dbo.eva_read_sumscore.x18c, 
      dbo.eva_read_sumscore.x18d, dbo.eva_read_sumscore.x19a, 
      dbo.eva_read_sumscore.x19b, dbo.eva_read_sumscore.x19c, 
      dbo.eva_read_sumscore.x19d, dbo.eva_read_sumscore.x20a, 
      dbo.eva_read_sumscore.x20b, dbo.eva_read_sumscore.x20c, 
      dbo.eva_read_sumscore.x20d, dbo.eva_read_sumscore.x1, 
      dbo.eva_read_sumscore.x2, dbo.eva_read_sumscore.x3, 
      dbo.eva_read_sumscore.x4, dbo.eva_read_sumscore.x5, 
      dbo.eva_read_sumscore.x6, dbo.eva_read_sumscore.x7, 
      dbo.eva_read_sumscore.x8, dbo.eva_read_sumscore.x9, 
      dbo.eva_read_sumscore.x10, dbo.eva_read_sumscore.x11, 
      dbo.eva_read_sumscore.x12, dbo.eva_read_sumscore.x13, 
      dbo.eva_read_sumscore.x14, dbo.eva_read_sumscore.x15, 
      dbo.eva_read_sumscore.x16, dbo.eva_read_sumscore.x17, 
      dbo.eva_read_sumscore.x18, dbo.eva_read_sumscore.x19, 
      dbo.eva_read_sumscore.x20 
 FROM dbo.eva_read_sumscore RIGHT OUTER JOIN 
      dbo.eva_teacher_sumscore ON 
      dbo.eva_read_sumscore.id = dbo.eva_teacher_sumscore.id AND 
      dbo.eva_read_sumscore.course_name = dbo.eva_teacher_sumscore.course_name 
;
SET QUOTED_IDENTIFIER OFF 
;
SET ANSI_NULLS ON 
;
update version set version='5.00.10'
;
