Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2002-08-15 : 09:09:45
|
| Deepak writes "Hi,I am having a stored Proc asRepSummary to which i pass a parameter @vchCategoryId varchar(100), in this parm i pass id's seperated by comma like -RepSummary '12,13,14'Now within the SP I use this value to filter query with INclause -SELECT * FROM SALE WHERE CATEGORYID IN(@vchCategoryId)however it gives following err -Server: Msg 245, Level 16, State 1, Procedure RepSummary , Line 6Syntax error converting the varchar value '12,13,14' to a column of data type int.pls guide on how to use param to be used in IN clausethanksdeepak" |
|
|
JustinBigelow
SQL Gigolo
1157 Posts |
Posted - 2002-08-15 : 11:45:40
|
| Dynmic SQL to the rescue...[url]http://www.sqlteam.com/item.asp?ItemID=4619[/url]hth,JustinHave you hugged your SQL Server today? |
 |
|
|
Page47
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2002-08-15 : 14:45:16
|
or...select <col_list>from salewhere charindex(isnull(convert(varchar,categoryid)+',',''),@vchcategoryid+',') Jay White{0} |
 |
|
|
|
|
|
|
|