match input parameter

Please support our MS SQL advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Aug 2009
Posts: 10
Reputation: Aussie_Here is an unknown quantity at this point 
Solved Threads: 0
Aussie_Here Aussie_Here is offline Offline
Newbie Poster

match input parameter

 
0
  #1
Aug 29th, 2009
I want to create a procedure which takes one input parameter(@name) and list all the fully or partially matching results. I used

  1. SELECT * FROM Table1
  2. WHERE Name LIKE @Name

but it didnt work. Can you help plz?
Last edited by peter_budo; Sep 7th, 2009 at 12:43 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 123
Reputation: cgyrob is on a distinguished road 
Solved Threads: 18
cgyrob's Avatar
cgyrob cgyrob is offline Offline
Junior Poster

Re: match input parameter

 
1
  #2
Aug 29th, 2009
Did you try using wild cards.

  1. SELECT * FROM Table1
  2. WHERE Name LIKE ('%' + @Name + '%')
Last edited by cgyrob; Aug 29th, 2009 at 7:06 pm.
Reply With Quote Quick reply to this message  
Join Date: Aug 2009
Posts: 10
Reputation: Aussie_Here is an unknown quantity at this point 
Solved Threads: 0
Aussie_Here Aussie_Here is offline Offline
Newbie Poster

Re: match input parameter

 
0
  #3
Aug 30th, 2009
Thanks a lot
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for MS SQL
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC