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

Can you create a logon trigger in sql server 2005 express edition?

1064


How to concatenate two strings in SQL Server.

1137


What are the operating modes in which database mirroring runs?

1062


What is #temp and @table variable in SQL server?

1064


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

929


Can I work with several databases simultaneously? : sql server management studio

969


What is sql language?

1110


How to create a new table in a given schema?

1165


What do you understand by mirroring and mention the advantages of the mirroring?

1046


What are the advantages of the mirroring?

1059


What is CTE in SQL

929


What are the types of subscriptions in SQL Server replication?

1014


What are window functions in sql server?

982


how many bits ip address consist of? : Sql server database administration

881


What is change data capture (cdc) feature?

1043