Prasad Bolla's SharePoint Blog

Click Here to go through the Interesting posts within my Blog.

Click Here to go through the new posts in my blog.

Thursday, February 09, 2012

Sql Server Stored Procedures Samples



Stored Procedures Samples
Procedure for delete
Create PROCEDURE sp_deluserdet(@uname nvarchar(50),@pwd nvarchar(50))
AS
begin
delete users where username=@uname and password=@pwd
end

Procedure for Select
create PROCEDURE sp_finduserdet(@uname nvarchar(50),@pwd nvarchar(50) output)
AS
begin
select @pwd=pwd from users where username=@uname
end

Procedure for Update
creatte PROCEDURE sp_upduserdet(@uname nvarchar(50),@pwd nvarchar(50))
AS
begin
update users set password=@pwd where username=@uname
end

Procedure for Insert
create PROCEDURE sp_insuserdet(@uname nvarchar(50),@pwd nvarchar(50))
AS
begin
insert into users values(@uname,@pwd)
end

No comments:

Post a Comment