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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Variable in Stored Procedure with coma

Author  Topic 

infodemers
Posting Yak Master

183 Posts

Posted - 2011-05-05 : 22:16:50
Hi,

How could I do something as follow:

if @company = '-All-'
Begin
Set @company = '44,48'
End

Select * from Mytable where company in(@company)

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2011-05-05 : 23:51:08
refer to here

http://vyaskn.tripod.com/passing_arrays_to_stored_procedures.htm
http://www.sommarskog.se/arrays-in-sql.html


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

infodemers
Posting Yak Master

183 Posts

Posted - 2011-05-06 : 07:56:33
Thanks a lot khtan for the links! :-)
Go to Top of Page
   

- Advertisement -