create a store procedure
CREATE procedure
SpDemoProcedure (
@Id int = null,
@Name varchar(100)= null,
@Age varchar(100)= null,
@Country varchar(100)= null,
@Action varchar(100)= null
)
As
begin
if
@Action = 'Insert'
Insert into
DemoRegistration values (@Name, @Age,
@Country)
if
@Action = 'Update'
Update
DemoRegistration set C_Name =
@Name, C_Age = @Age,
C_Country = @Country where C_Id
= @Id
if
@Action = 'Delete' Delete from
DemoRegistration where C_Id = @Id
--if @Action ='Search'
-- select * from
DemoRegistration where C_Name like '_d%'
end
Comments
Post a Comment