在sqlserver2005执行存储过程,为什么老是说必须声明标量变量@majorid??????@pagesize int,
@majorid nvarchar(50)SET @SQLSTR =N'SELECT TOP '+STR(@PageSize)+'* from Course where courseid=any(select courseid from teacher_course where majorid=@majorid) ORDER BY course.CourseID ASC'
@majorid nvarchar(50)SET @SQLSTR =N'SELECT TOP '+STR(@PageSize)+'* from Course where courseid=any(select courseid from teacher_course where majorid=@majorid) ORDER BY course.CourseID ASC'
SET @SQLSTR =N'SELECT TOP '+STR(@PageSize)+' * from Course where courseid=any(select courseid from teacher_course where teacher_course.majorid='+@majorid 执行结果 @majorid = N'0002',
@PageIndex = 0,执行的时候又说 “'0002' 附近有语法错误。”我应该怎么改呢
此消息通过 【CSDN论坛 Winform测试版】 回复!