急,往存储过程里传带,号的参数 存储过程 in(参数)不出来
往存储过程里传带,号的参数 存储过程 in(参数)不出来
一个存储过程参数 如(1,2,3,4,5,6)
传给存储过程
存储过程里面
该参数我在存储过程里设置了 varchar(255)类型
select * from b where btype in(传进的参数)
查不出来
[解决办法]
一个存储过程参数 如(1,2,3,4,5,6)
传给存储过程
存储过程里面
该参数我在存储过程里设置了 varchar(255)类型
select * from b where btype in(传进的参数)
查不出来
--------------
select * from b where charindex( ', '+btype+ ', ', ', '+@str+ ', ')> 0
[解决办法]
exec ( 'select * from b where btype in( ' + 传进的参数 + ') '
[解决办法]
--用charindex或动态SQL
exec ( 'select * from b where btype in( ' + 传进的参数 + ') '
[解决办法]
一个存储过程参数 如(1,2,3,4,5,6)
---------------------
主,是一字符串吧
[解决办法]
用wangtiecheng老大的,你的必是一一的,我想用在你是不行的
[解决办法]
declare @sql varchar(1000)
select @sql= 'select * from #table where id in ( '+ @参数 + ') '
execute @sql
[解决办法]
如果你不用动态 而直接
select * from #table where id in (@参数)
的话
程式会把 @参数 看做一个整体... 而不会自己按逗号拆开.
[解决办法]
如果是前台调用就简单多了