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

Programmingway@Eklavya Technosys!: JAC Board Computer Examination Sample Questions Hi...

Programmingway@Eklavya Technosys!: JAC Board Computer Examination Sample Questions Hi... : 1) Which of the following is NOT a web service? (...