在吗 问个问题啊
--试卷表(存放考生考的试卷)
create table Exam
(
ExamId int primary key identity(1,1), --试卷id
UserNumber char(20) references UserDetails(UserNumber), --考试编号(外键)
ExamSexId int references ExamSex(ExamSexId), --做的是那套试卷(外键)
IsSubmit bit not null, --是否提交
)
--根据考生编号,试卷设计id,在试卷表实例化这个试卷(添加成功返回添加的id,就是这个ExamId,添加失败,返回ExamId为0)
create proc sql_addExam
@UserNumber char(20), --考生编号
@ExamSexId int --试卷设计id
添加的时候试卷是否提交,设置为0
麻烦大家写好注释,按照我要求给我答案,谢谢大家啦
--试卷表(存放考生考的试卷)
create table Exam
(
ExamId int primary key identity(1,1), --试卷id
UserNumber char(20) references UserDetails(UserNumber), --考试编号(外键)
ExamSexId int references ExamSex(ExamSexId), --做的是那套试卷(外键)
IsSubmit bit not null, --是否提交
)
--根据考生编号,试卷设计id,在试卷表实例化这个试卷(添加成功返回添加的id,就是这个ExamId,添加失败,返回ExamId为0)
create proc sql_addExam
@UserNumber char(20), --考生编号
@ExamSexId int --试卷设计id
添加的时候试卷是否提交,设置为0
麻烦大家写好注释,按照我要求给我答案,谢谢大家啦
@UserNumber char(20), --考生编号
@ExamSexId int --试卷设计id
as
begin
declare @Flag int --返回值
insert into Exam(UserNumber,ExamSexid,IsSubmit)
values(@UserNumber,@ExamSexId,0)
set @Flag=isnull(@@IDENTITY,0)
select @Flag
end