我的参数有问题如果我传入一个特定的东西
即
@Sdate=01-01-2014, @edate =07-01-2014, @bd = Hobson, @CG= 01,02,03,04我得到数据,一切都很完美
如果我传入
@Sdate=01-01-2014, @edate =07-01-2014, @bd = Hobson,Jerry,garry,bob,james @CG= 01,02,03,04我甚至没有得到任何hobsons数据
在你问我的参数传递多个条件之前已经设置好了
in (@parameterName)im having issues with my parameters If i pass in a specific thing
i.e
@Sdate=01-01-2014, @edate =07-01-2014, @bd = Hobson, @CG= 01,02,03,04i get data and everything works perfect
if i pass in
@Sdate=01-01-2014, @edate =07-01-2014, @bd = Hobson,Jerry,garry,bob,james @CG= 01,02,03,04i get nothing not even hobsons data
before you ask my parameters passing multiple conditions are already set in
in (@parameterName)最满意答案
我怀疑问题是你正在尝试使用逗号分隔列表作为IN子句的一部分。 你不能这样做。 您必须首先或更好地解析这些分隔值,传入表值参数。 这篇文章解释了如何拆分分隔值。
http://sqlperformance.com/2012/07/t-sql-queries/split-strings
I suspect the problem is you are trying use a comma delimited list as part of an IN clause. You can't do that. You have to parse those delimited values first or better yet, pass in a table value parameter. Here is an article explaining how to split your delimited values.
http://sqlperformance.com/2012/07/t-sql-queries/split-strings
更多推荐
发布评论