create Proc insert_Returns
@RID int output,
@ReturnsType int,
@CSPrefix varchar(50)
AS
begin
if not exists(select ReturnsType from tbl_ReturnSetings where RID=@RID)
begin
INSERT [dbo].[tbl_ReturnSetings]
(
[ReturnsType],
[CSPrefix]
)
VALUES
(
@ReturnsType,
@CSPrefix
)
SELECT @RID=SCOPE_IDENTITY();
end
else
begin
update tbl_ReturnSettings
SET CSPrefix = @CSPrefix
where RID=@RID
end
end
Pls help me
When am insert new values above procedure working fine but the ReturnsType is exists CSprefix not updated ......