本文介绍了如何为SQL select查询传递multisearch参数..?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 DECLARE @EmpIDtte AS varchar(50) --SET @EmpIDtte = null SET @EmpIDtte = '42,40' 打印@EmpIDtte 从MulitSearch_Portal中选择*(@EmpIDtte IS NULL OR(LegalTypeID IN(@EmpIDtte))) 我尝试了什么: 我使用上面的查询,他们使用传递参数@EmpIDtte = null和@EmpIDtte = '42 '....同时我传递@EmpIDtte = '42,40'mulit参数。,他们得到错误plz帮助.. 错误:转换varchar值时转换失败'42,40'到数据类型int 解决方案 DECLARE @EmpIDtte AS varchar(50)--SET @EmpIDtte = nullSET @EmpIDtte = '42,40' print @EmpIDtteselect * from MulitSearch_Portal where (@EmpIDtte IS NULL OR ( LegalTypeID IN (@EmpIDtte)))What I have tried:I m using above this query they working with passing parameter "@EmpIDtte = null" and "@EmpIDtte = '42' " ....and the same time i m passing "@EmpIDtte = '42,40' " mulit parameter., they getting error plz help..Error: Conversion failed when converting the varchar value '42,40' to data type int 解决方案 这篇关于如何为SQL select查询传递multisearch参数..?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-24 23:33