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

What is the difference between ‘having’ clause and a ‘where’ clause?

1037


what are defaults? : Sql server database administration

1088


How to create an identity column?

1218


What is the bookmark lookup and rid lookup?

997


What is the use of partition by in sql server?

931


How to transfer an existing table from one schema to another schema in ms sql server?

981


What is rtm version in sql server?

1049


why would you call update statistics? : Sql server database administration

1086


How to use clusters?

944


Write down the syntax and an example for create, rename and delete index?

982


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

983


Explain time data type in sal server 2008?

920


Name and describe few console utilities for ssrs?

284


What is optimistic concurrency?

1038


List the different types of collation sensitivities in sql server?

1044