User Input Parameter for SQL Query

I need to create a very simple query.  I would like to return all the data from one table for a specific item.  I want the user to be prompted to enter the item id.  Below is an example of the query without letting my user enter the item.

Select * from inventory
where inventory.item_id = 'AQUA-12345'

I just want this to be generic so my user is prompted to enter the item they are looking for.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I am assuming SQL 2000 based upon the tags.

You would pass a parameter in to a procedure.

create procedure up_inventory_get
 @item_ID varchar(30)
select * from inventory
where item_id = @item_id

to call it:

exec up_inventory_get @item_ID = 'AQUA-12345'
from where do you run the query?

basically, you need to prompt to the user and get the input, and then bind the parameter in the below query

Select * from inventory
where item_id = ?

RDB1369Author Commented:
This is exactly what I have done so far, and yes you are right I am working in SQL 2000.  
However, I really wanted my user to be able to just exec the stored procedure and be asked the question  "Enter Item",   Is this possible?
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

RDB1369Author Commented:
I am sorry I did not see the second comment when I posted my response.  I have written a procedure like Brandon suggested and I can use that, but I wanted to just have my user type in
          Exec Up_inventory_get
and then the first part of the procedure would prompt my user to enter the correct item ID.
i don't think you can do that since stored procedure is server-side object,

what you may do is to create a .bat (if it's in windows environment) or a shell script to achieve that
I think it's time to close this question up.

You said you used a procedure like http:#22815829 and I answered your question about prompting for input in http:#22815907

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
RDB1369Author Commented:
I guess this is as good as it gets
Why the B grade?  Unfortunately, you can't do what it is you are asking to do.  I answered your question completely and accurately.

I'd like you to reconsider the grade based upon the grading suggestions here (copied from help):

What's the right grade to give?

Grading at Experts Exchange is not like school. It's more like the "10-point Must" system in professional boxing; in other words, an answer is worth an A, unless it doesn't resolve your issue. If it requires you to do a little more research, or figure out one more piece of code, then it's worth a B. If you think it's not worth a B, the custom is to offer the Experts an opportunity to earn a better grade.

Giving a higher grade has no impact on your Available Points.
No Response to Expert and/or Moderator.
Force changed.
Experts Exchange Moderator
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.