Click here to Skip to main content
15,919,749 members

Comments by v.latha (Top 58 by date)

v.latha 5-May-14 8:05am View    
I got the answer
v.latha 5-May-14 7:52am View    
thanks
v.latha 5-May-14 7:05am View    
and this is my stored procedure
ALTER PROCEDURE sp_quantity
(@cid nvarchar(50),@prodid nvarchar(50),@price money,@qty nvarchar(50),@total money,@date date,@status nvarchar(50),@error varchar(500) OUT)
/*
(
@parameter1 int = 5,
@parameter2 datatype OUTPUT
)
*/
AS
begin
if exists(select quantity from Products where quantity=@qty)
begin
insert into Sales_Order
(
CustomerId,
ProductId,
Price,
Quantity,
Total,
Date_Of_Deliver,
Status)
values
(@cid,
@prodid,
@price,
@qty,
@total,
@date,
@status)
set @error='registered successfully'
end
else
begin
set @error='quantity doesnot exist'

end
end

/* SET NOCOUNT ON */
RETURN
v.latha 5-May-14 5:19am View    
yes I got the answer
v.latha 3-May-14 3:47am View    
I have two tables products table and sales order table
when I insert the data in sales order in the page if the quantity is doesnot exist in products i want to show error message