March 18, 2013 at 1:24 am
Guys,
Declare @string VARCHAR(MAX)
SET @string IN ('sql','server','2008')
Here, How to find a comma in the above string?
whether comma(,) exists or it is single value
I want to solve the below example
SELECT CASE WHEN @string = 'some string' THEN 'XYZ'
WHEN @string IN (,) THEN 'abc' ---- the will be comma separated multiple value('sql','server','2008')
FROM my_table
If comma exist in the string then i want to print value.
March 18, 2013 at 1:45 am
I got the solution..
CHARINDEX(',' ,@string) > 0
Thanks
Farooqh
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy