Invalid Column Name Error but column exist in table
alter proc SellingComputation
@ItemName nvarchar(50),
@InvoiceID nvarchar(50),
@Quantity int,
@SellingPrice numeric(18,2),
@UnitID int,
@Discount numeric(18,2)
as
begin
insert into SellingDetails (ItemName,InvoiceID,Quantity,SellingPrice,DiscountPrice,ItemTotal) values (@ItemName,@InvoiceID,@Quantity,@SellingPrice, @UnitID, @SellingPrice-(@Discount/100),(@SellingPrice*@Quantity)- DiscountPrice )
end
DiscountPrice is not exist.I want to compute itemTotal.table script
CREATE TABLE [dbo].[SellingDetails](
[SDid] [int] IDENTITY(1,1) NOT NULL,
[InvoiceID] [nvarchar](50) NOT NULL,
[ItemName] [nvarchar](50) NOT NULL,
[Quantity] [int] NOT NULL,
[SellingPrice] [numeric](18, 2) NOT NULL,
[UnitID] [int] NOT NULL,
[DiscountPrice] [numeric](18, 2) NULL,
[ItemTotal] [numeric](18, 2) NOT NULL,
CONSTRAIN ...
Go to the complete details ...