I am using the below code but want to have the searchterm do:
name like '%@searchterm%'
but can't get the syntax to work
--Create a temporary table
CREATE TABLE #TempItems
(
ID int IDENTITY,
Name varchar(250),
PID int
)
-- Insert the rows from tblItems into the temp. table
INSERT INTO #TempItems (Name, pid)
SELECT Name,id FROM courses WHERE name = @searchterm ORDER BY name
name like '%@searchterm%'
but can't get the syntax to work
--Create a temporary table
CREATE TABLE #TempItems
(
ID int IDENTITY,
Name varchar(250),
PID int
)
-- Insert the rows from tblItems into the temp. table
INSERT INTO #TempItems (Name, pid)
SELECT Name,id FROM courses WHERE name = @searchterm ORDER BY name