Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Explain different types of Normalization.

1729


Mention the differences between local and global temporary tables.

951


What is difference statement and preparedstatement?

932


Explain sql delete command?

1002


What is spid in sql server profiler?

1025


How to use transact-sql statements to access the database engine?

994


Create a dts package to produce a text file using the ‘update statistics’ command for the tables in a database with obsolete statistics.

968


What is the difference between implicit and explicit transaction?

959


How do I get to sql server configuration manager?

951


What is command parameter in ssrs?

153


How extra digits are handled with numeric data type literals?

903


What is the difference between commit and rollback?

875


What is a partition function in sql server?

1020


What happens if you delete a table that is used by a view?

938


What is the difference between cartesian product and cross join?

811