首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > ASP >

程序里面的sql语法异常

2013-04-26 
程序里面的sql语法错误 select top @sizea.Action_ID, a.[User_ID], a.Total_Score ,b.Action_Desp,b.Cre

程序里面的sql语法错误



" select top @size  a.Action_ID, a.[User_ID], a.Total_Score ,b.Action_Desp,b.CreateTime ,b.Point_Change from "
        + " tbl_Action_Hist b inner join tbl_Record_Score a on a.Action_ID=b.Action_ID  where a.Action_ID  not in (select top (@size * (@now -1)) a.Action_ID  from  "
        + " tbl_Action_Hist b ) and b.Student_ID=@stuid and b.Point_Change like '-%'  and b.CreateTime between @starTime and  @endTime"


这些参数的类型string stuid, int size, int now, DateTime starTime, DateTime endTime
在sql里面没报错,但在程序里面运行之后报错。
'@size' 附近有语法错误。
关键字 'and' 附近有语法错误。
[解决办法]
断点调试一下,看看在程序里面运行的SQL语句是什么样子的?

热点排行