2
Answers

how to return some values from insert procedure?

Prasad Bhagat

Prasad Bhagat

8y
350
1
Dear all ,
 
i have a proc like bellow ,
 
create proc insertdata(@fname varchar( 100),@lname varchar(100),@mobile varchar(100)
as 
begin
insert into emp (fname,lname,mobile)values (@fname,@lname,@mobile)
end
 
 
as of now perfect ,
 
now i want to return if the proc is executed succesfully then i want to retun two varables like 
 
StatusInd=1 and StatusMsg="Inserted"
 
else 
 StatusInd=-1 and StatusMsg="NoInserted"
 
 so please help me how can i create proc using sql server
Answers (2)