Need to add a discount to a order table | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Need to add a discount to a order table

I 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)
as
insert into ordertable values(@OrderID,@ProiductID,@UnitPrice,@Quantity, @DiscountValue)
select * from ordertable
go
Thank you very much, it works great. Dennis
]]>