Can you give an example of Stored Procedure?
Answer Posted / madhesan
create database mani
use mani
create table emp
(
empno int,
empname varchar(20),
salary int
)
select * from emp
insert into emp values(2,'hari',10000)
create procedure selectproc
as select * from emp
exec selectproc
create procedure insertproc
@no int,
@name varchar(20),
@salary int
as
insert into emp values(@no,@name,@salary)
exec insertproc1 2,'pavan',15000
create procedure insertproc1
@no int,
@name varchar(20),
@salary int
as
if @no=1
print 1
else
insert into emp values(@no,@name,@salary)
print "successfully inserted!!!"
select * from syscolumns
sp_helpdb mani
sp_help selectproc
sp_helptext selectproc
set isolation level serializable
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is data mart? : sql server analysis services, ssas
What is the difference between for trigger and after trigger?
What is 2nf normalization?
What are different types of statement?
How to fetch the next row from a cursor with a "fetch" statement?
Where do you find the default Index fill factor and how to change it?
How does clustered and non clustered index work?
What does asynchronous call backs means?
How to change parameter value inside the report?
What are commit and rollback in sql?
What is difference between rownum and row_number?
What causes index fragmentation?
What are drilldown reports?
Explain transaction server isolation?
1.what are diff types of joins , and explain diff between cross join and full outer join 2.diff types of views 3. Diff types of index 4. What is diff b/w stores procedure and function procedure 5.diff between double and int in SQL 6.diff between char and varchar in SQL. 7.Oracle or SQL whice you will preferred and why.