OK - so this is a lookup table ? I'm guessing it's a one to many lookup table, the orderID is unique ? Do you know any SQL at all ? Or are you working on someone elses database ? To create a stored proc, you want to run the SQL Server client tools, which will also give you access to the books online, which would cover these sort of basic queries for you. However, if you're not comfortable with what you're doing, and you're part of a team, you need to be talking to your manager, so he knows where you're at with SQL and so you don't do any damage to the database.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog