I'm having a problem in SQL that I'm unable to solve up until now. If I have a table with this data:
| id | name |
| 1 | abc |
| 2 | abd |
| 3 | def |
| 4 | zxd |
I want to create a procedure that receives a string as a parameter and returns all the rows in which the "name" column is contained in the parameter string.
For example, calling the procedure like this:
EXEC [Procedure] 'abxxxxxx'
would return rows 1 and 2 ("ab" is contained in the string 'abxxxxxx'). Calling the procedure like this:
EXEC [Procedure] 'abcxxxxxx'
would return only row 1.
Any ideia on how I can do this?
Thanks in advance