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
Can a database be shrunk to 0 bytes, if not, why?
What are different types of collation sensitivity?
can a database be shrunk to 0 bytes, if not, why? : Sql server administration
Which Model uses the SET concept
Can a trigger be created on a view?
Tell me in brief how sql server enhances scalability of the database system?
Where can you add custom error messages to sql server?
If the job running very slow what is the action you do
What do you understand by sql server agent?
What happens if null values are involved in boolean operations?
What are the advantages of passing name-value pairs as parameters?
What is the fastest way to permanently delete a 1 million row table named customers?
How to defragment table indexes?
What are the different types of normalization?
What is the difference between a "where" clause and a "having" clause?