How to configure SQL LIKE function?

I want to make a query like this:

create procedure something
  @name varchar(13)
as
begin

  select * 
   from WORKER
  where NAME LIKE "%@name%"

end

For input, @name=hoI want to output every line containing NAME that sounds ho,

e.g. HOuse, soHO, broHOw ...

+3
source share
2 answers
Select * from WORKER where Name Like '%' + @name + '%'
+9
source
create procedure something
@name varchar(13)
as
begin
select * from WORKER
where NAME LIKE '%' + @name + '%'
end
+2
source

Source: https://habr.com/ru/post/1737934/


All Articles