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
Explain different types of Normalization.
Mention the differences between local and global temporary tables.
What is difference statement and preparedstatement?
Explain sql delete command?
What is spid in sql server profiler?
How to use transact-sql statements to access the database engine?
Create a dts package to produce a text file using the ‘update statistics’ command for the tables in a database with obsolete statistics.
What is the difference between implicit and explicit transaction?
How do I get to sql server configuration manager?
What is command parameter in ssrs?
How extra digits are handled with numeric data type literals?
What is the difference between commit and rollback?
What is a partition function in sql server?
What happens if you delete a table that is used by a view?
What is the difference between cartesian product and cross join?