single stored procedure for insert,select,delete

Karthikreddy
Posted by Karthikreddy under Sql Server category on | Points: 40 | Views : 972
Create proc [dbo].[sp_insert]
@id int,
@FirstName varchar(50),
@LastName varchar(50),
@Email varchar(50),
@City varchar(50)
as
begin
if @id=1
begin
insert into jkarthik.dbo.reddy(FirstName,LastName,Email,City) values(@FirstName,@LastName,@Email,@City)
end
if @id=2
begin
select * from jkarthik.dbo.reddy
end
if @id=3
update jkarthik.dbo.reddy set City=@City where Email=@Email
end

Comments or Responses

Login to post response