Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DECLARE @item VARCHAR(50)
- SET @ExpressionToSearch = '23,12'
- SET @item = '23'
- SELECT COUNT(*) from dbo.Split(@ExpressionToSearch,',')
- WHERE ',' + (@ExpressionToSearch) + ','
- LIKE '%'+@item +'%'
- select count(*) FROM table where id = '5';
- Declare @MyString varchar(50)
- Set @MyString = '1,2,3,4,5'
- IF CHARINDEX('5',ContactName) > 0
- Begin
- Print '5 Exists'
- End
- Else
- Begin
- Print '5 Does not exists'
- End
- SELECT column FROM table WHERE CHARINDEX(',5,',(',' + column + ',')) > 0
- ',1,2,3,4,5,'
- ',5,'
- SELECT column FROM table WHERE column like '%,5,%';
- SELECT column FROM table WHERE CHARINDEX(',5,',(',' + column + ',')) > 0
- ',5,50,150,250,350,450,500,'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement