SQL Server Performance Forum – Threads Archive
Need to add a discount to a order tableI need to create a stored procedure to add a discount to an order. This stored procedure has five input parameters: OrderID, ProiductID, UnitPrice, Quantity, and DiscountValue. This stored procedure needs to display all the orders with a discount, including the ones added by the stored procedure. Any suggestions would be helpful.
So, Do you want to compute the discount value from the given data? Madhivanan
No, just need the ability to input a discount already known.
create procedure insert_select(@OrderID as int , @ProiductID as int, @UnitPrice as money, @Quantity as money, @DiscountValue as money)
insert into ordertable values(@OrderID,@ProiductID,@UnitPrice,@Quantity, @DiscountValue)
select * from ordertable
Thank you very much, it works great. Dennis