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 the difference between ‘having’ clause and a ‘where’ clause?
what are defaults? : Sql server database administration
How to create an identity column?
What is the bookmark lookup and rid lookup?
What is the use of partition by in sql server?
How to transfer an existing table from one schema to another schema in ms sql server?
What is rtm version in sql server?
why would you call update statistics? : Sql server database administration
How to use clusters?
Write down the syntax and an example for create, rename and delete index?
What happens if you delete a table that is used by a view?
Explain time data type in sal server 2008?
Name and describe few console utilities for ssrs?
What is optimistic concurrency?
List the different types of collation sensitivities in sql server?