简单的存储过程,看看错在哪里呢? ALTER PROCEDURE get_paper_id @course varchar(30), @year numeric(4,0), @semester varchar(8), @paper_name varchar(100) AS declare @sql nvarchar(100) declare @id varchar(10) begin set @sql='select @id=id from paper where 课程='''+@course+''' and 年份='''+@year+''' and 学期='''+@semester+''' and 试题='''+@paper_name+'''' exec sp_executesql @sql end RETURN @id