latest Post

How to Create Stored procedure in SQL Server



Insert procedure

CREATE PROCEDURE sp_insert
       @name varchar(50),
       @password nvarchar(12)
AS
begin
insert into tbl_login(name,password) values(@name,@password)
end

Select Procedure


CREATE PROCEDURE sp_select
       @name varchar(50),
       @password nvarchar(12)
AS
begin
       SELECT name,password from tbl_login where username=@name and password =@password
end


Update Procedure


CREATE PROCEDURE sp_update
       @password nvarchar(12),
       @Id int
AS
begin
       Update tbl_login set password=@password where Id=@Id
       end


Delete Procedure


CREATE PROCEDURE sp_delete
       @Id int
AS
begin
       delete from tbl_login where Id=@Id
end

About Mallikarjun A

Mallikarjun A
Recommended Posts × +

0 comments:

Post a Comment