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
 how to get exactly word in a phrase using LIKE

Author  Topic 

t0ze
Starting Member

10 Posts

Posted - 2010-10-14 : 05:02:38
I have a string like this;

'word1, word, in a letter'

And what i would like to do is searching in that string one word1

LIKE '%' Word1 '%'

And get only word1.

i'm getting word and word1 in this example of my like.

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-10-14 : 05:05:41
This example of your like will not work.
Give us a better (real?) example please.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

t0ze
Starting Member

10 Posts

Posted - 2010-10-14 : 05:21:15
Hi webfred, tks for your reply. Here it is, hope it help to understand my question, if not please, say something

Cheers


SELECT {MENU_ITEM}.*
FROM {MENU_ITEM}
WHERE {MENU_ITEM}.[Permission] LIKE '%' + @Permission + '%'
AND {MENU_ITEM}.[EspaceName] LIKE '%' + @EspaceName + '%'
ORDER BY {MENU_ITEM}.[Order] ASC



@'ADM'
@'DropDown2'

Table MENU_ITEM

ID | Permission | Espace
1 | ADM, View | DropDown
2 | View, Edit | DropDown
3 | Edit | DropDown
4 | ADM, View, Edit | DropDown2 <is this one i need to get



Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-10-14 : 05:26:17
That should work.
But what is that with the { and }?
Is that MS SQL Server?


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

t0ze
Starting Member

10 Posts

Posted - 2010-10-14 : 05:34:56
Yes it's MS SQL, used in OutSystems (http://www.outsystems.com/)
Here is a screen shot of the development tool called (Service Studio) - http://dl.dropbox.com/u/1863845/DropDown.PNG

it doesn't work here, but i solved this using DD2 instead of DropDown2

Tks for the help
Go to Top of Page
   

- Advertisement -