Saturday, January 2, 2016

SQL PROCEDURE CONCEPT

create proc usp_Del
@id int
as
delete from Employee where id=@id
exec usp_Del 1007
sql procedure
select * from employee
create proc pro_update2
@id int,
@salary money
as
update employee1
set salary=@salary
where id=@id
exec pro_update2 1,8500
select * from employee1

alter proc USP_Select6
@id int,
@name varchar(20),
@salary money,
@comm money
as
insert into employee1 values (@id,
@name,
@salary,
@comm
)
exec USP_Select6 3,'Ramesh',12500,250
select * from employee1

create procedure insert1
@rno int,
@name varchar(20),
@gender varchar(10),
@city varchar(10),
@msg varchar(20)
as
insert into stud(rno,sname,gender,city,msg) values(@rno,@name,@gender,@city,@msg)


select * from stud
execute insert1 102,'Sunil','Male','JAP','Well Done'


No comments:

Post a Comment

Computer Network & Computer Features | Bal Varg | Computer Questions List!

  Computer Network & Computer Features 1) _______ is a thin strip like bar present at the bottom of the screen.   Taskbar 2) _______ ser...