My pride doesn't like me asking this... But I'm getting desperate. I 'm trying to create a stored procedure that will search multiple tables using one variable (orderid, located in all tables). The code parses ok, but on execute, I get the message "Ambiguous column name 'orderid' ".
My code looks like this:
CREATE PROCEDURE sp_Get_Order_Items
@orderid int
AS
SELECT OrderItems.name, OrderItems.quantity, OrderItems.notes, ItemStatus.statusid
FROM OrderItems JOIN ItemStatus
ON OrderItems.orderid = ItemStatus.orderid
WHERE orderid = @orderid
Can anyone give advice? Or recommend a website? Thanks!
2007-03-27
10:02:14
·
4 answers
·
asked by
aerisaoi
1
in
Computers & Internet
➔ Programming & Design