need to insert two table at a time and delete one table.like
after i click the button in front end
need to insert two table at a time
example
table1
date 18.8.13
productname cement
price 300
extra 10 (price+extra)=310
total=310
vat 14.5/100 (310*14.5/100)=44.95
netamount=total price+vat as 310+44.95=354.95
the total is 354.95
now table 2
have to save date,productname,price,vat,totalamount
date 18.8.13
productnamee closeup
pricce 50
vat 14.5/100
total=price *14.5/100=57.25 rupees
Loading

Jignesh TrivediPosted Aug 18, 2013, 11:16 PM
Hi,
correct my undertanding, In store procedure you want to perform Insert operation in two table and delete operation on one table.
Create Store procedure Test
(
@date datetime,
@productname varchar(50),
@price float,
@extra float
)
AS
begin
declare @total float = (@price+@extra)
declare @vat float = 14.5
declare @netamount float = @total + (@total*@Vat/100)
Insert into table1(date,productname,price,extra,toatl,vat,netamount)
values(@date,@productname,@price,@extra,@toatl,@vat,@netamount)
Insert into table2 (date,productname,price,vat,total)
values (@date,@productname,@price,@vat,@netamount)
-- write delete code here...
end
Also we are not clearly get you quesition please provide more information
Iftikar HussainPosted Aug 18, 2013, 4:33 AM
Regards,
Iftikar
selvi subramanianPosted Aug 18, 2013, 4:31 AM
Iftikar HussainPosted Aug 18, 2013, 3:47 AM
In what condition you need to delete record from one table. I am not clear about your requirement. Please provide more details.
Regards,
Iftikar