参数不起作用(Parameters Not working)

编程入门 行业动态 更新时间:2024-10-24 01:51:44
参数不起作用(Parameters Not working)

我的参数有问题如果我传入一个特定的东西

@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,04

i 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,04

i 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

更多推荐

本文发布于:2023-08-02 14:19:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1376937.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:不起作用   参数   working   Parameters

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!