hi,
Try like this...
create Procedure [dbo].[pro_Monitor]
(
@Monitor_Name varchar(50),
@Monitor_model varchar(50),
@Monitor_O_N int ,
@Qty_Device_ID varchar,
@Qty_Recived bigint
)
As
Begin
DECLARE @Monitor_ID varchar(50)=NULL
SELECT @Monitor_ID ='P'+CAST(NextValue AS VARCHAR(10)) FROM sysPeram WHERE Code='Monitor'
SELECT @Qty_Device_ID=@Monitor_ID
insert into dbo.monitor (Monitor_ID ,Monitor_Name,Monitor_date,Monitor_model,Monitor_O_N )
values (@Monitor_ID ,@Monitor_Name,getdate(),@Monitor_model,@Monitor_O_N);
insert into dbo.Tbl_ReceivedQty(Qty_Device_ID,Qty_Received)
values (@Qty_Device_ID,@Qty_Recived);
UPDATE sysPeram SET NextValue=NextValue+1 WHERE Code='Monitor'
end
GVPrabu