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 you create a logon trigger in sql server 2005 express edition?
How to concatenate two strings in SQL Server.
What are the operating modes in which database mirroring runs?
What is #temp and @table variable in SQL server?
you have a table with close to 100 million records recently, a huge amount of this data was updated now, various queries against this table have slowed down considerably what is the quickest option to remedy the situation? : Sql server administration
Can I work with several databases simultaneously? : sql server management studio
What is sql language?
How to create a new table in a given schema?
What do you understand by mirroring and mention the advantages of the mirroring?
What are the advantages of the mirroring?
What is CTE in SQL
What are the types of subscriptions in SQL Server replication?
What are window functions in sql server?
how many bits ip address consist of? : Sql server database administration
What is change data capture (cdc) feature?