Click here to Skip to main content
15,916,215 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
where description like "'%"+prog+"%'"..... it gives me an error that says "invelid column name '%". " pls help. how to Searching for three or more words in SQL eg:- "Project management workbook" even if you start by entering "management" it must able to return the results

My Storedproc

SQL
ALTER PROCEDURE [dbo].[sp_Search]  
	@Search varchar(255) 
AS
BEGIN
	
	SET NOCOUNT ON; 
	declare @strpart1 varchar(255) select @strpart1 = SUBSTRING( @Search,CHARINDEX(' ', @Search,1),(LEN(@Search) - CHARINDEX(' ', @Search,1) + 1))
	
    -- Insert statements for procedure here
    Select Description from ['Portal Catalogue$'] 
    where Description Like '%'+@strpart1+'%' 
END
Posted
Updated 25-Aug-11 2:47am
v2

1 solution

for ur eg:"Project management workbook"

Query:Select [column name] from [table name]where [column name]like '%management%'

http://www.webmasterworld.com/forum88/8794.htm
Hope this reference link would also help you..!!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900