通过有JSP页面穿到存储过程中一连串的ID值,并且以,隔开。我们要在数据库中根据这些ID值把数据删除。技巧
else if @SubmitButtonFlag='delete' -- 删除
begin
set @ID=''''+replace(@ID,',',''',''')+''''
set @SQLList ='select ID into ##temp10 from TrainExamTemplateCourse where ID in ('+@ID+') '
exec (@SQLList)
delete
TrainExamTemplateCourse
from
TrainExamTemplateCourse,##temp10
where
TrainExamTemplateCourse.ID=##temp10.ID
drop table ##temp10
set @OperDesc=@SubmitButtonFlag+' TrainExamTemplateCourse'
end