程序里面的sql语法错误

heli_1005 2013-04-25 05:54:14


" 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' 附近有语法错误。
...全文
106 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
heli_1005 2013-04-26
  • 打赏
  • 举报
回复
引用 1 楼 maco_wang 的回复:
断点调试一下,看看在程序里面运行的SQL语句是什么样子的?
调试的时候 把sql贴到sql窗口里面都没错,就在程序里面有错
叶子 2013-04-25
  • 打赏
  • 举报
回复
断点调试一下,看看在程序里面运行的SQL语句是什么样子的?

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧