943,699 Members | Top Members by Rank

Ad:
  • MS SQL Discussion Thread
  • Marked Solved
  • Views: 696
  • MS SQL RSS
Aug 29th, 2009
0

match input parameter

Expand Post »
I want to create a procedure which takes one input parameter(@name) and list all the fully or partially matching results. I used

sql Syntax (Toggle Plain Text)
  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.
Reputation Points: 10
Solved Threads: 1
Newbie Poster
Aussie_Here is offline Offline
18 posts
since Aug 2009
Aug 29th, 2009
1

Re: match input parameter

Did you try using wild cards.

sql Syntax (Toggle Plain Text)
  1. SELECT * FROM Table1
  2. WHERE Name LIKE ('%' + @Name + '%')
Last edited by cgyrob; Aug 29th, 2009 at 7:06 pm.
Reputation Points: 91
Solved Threads: 18
Junior Poster
cgyrob is offline Offline
125 posts
since Sep 2008
Aug 30th, 2009
0

Re: match input parameter

Thanks a lot
Reputation Points: 10
Solved Threads: 1
Newbie Poster
Aussie_Here is offline Offline
18 posts
since Aug 2009

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in MS SQL Forum Timeline: date check constraint
Next Thread in MS SQL Forum Timeline: contains forms of inflectional





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC