Prasad Bhagat

Prasad Bhagat

  • NA
  • 516
  • 234.9k

how to return some values from insert procedure?

Mar 21 2016 7:40 AM
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)