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?

Answers were Sorted based on User's Feedback



Can you give an example of Stored Procedure?..

Answer / guest

sp_helpdb , sp_who2, sp_renamedb are a set of system defined
stored procedures. We can also have user defined stored
procedures which can be called in similar way.

Is This Answer Correct ?    4 Yes 0 No

Can you give an example of Stored Procedure?..

Answer / ghous

user defines sp...
say i want to select some values based on parameter

create sp dbo.spname
'declare var

@parametername int
as
select * from table_name
where file_name=@parametername

Is This Answer Correct ?    4 Yes 1 No

Can you give an example of Stored Procedure?..

Answer / 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

Can you give an example of Stored Procedure?..

Answer / jyothi

user defines sp...
say i want to select some values based on parameter


create PROCEDURE GetEmployeeDetails
-- Add the parameters for the stored procedure here
@sno int,



-- Insert statements for procedure here


select *from emp where sno=@sno


END
GO

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More SQL Server Interview Questions

How to select Distinct columns from the table, table having 20 columns and i want all coulmns

5 Answers   Wipro,


What is the difference between update lock and exclusive lock?

0 Answers  


Can we write trigger for view?

0 Answers  


what are the types of indexes? : Sql server database administration

0 Answers  


Why we need to use secondry database file? though, we can do same work using primary database file also.

2 Answers   Microsoft,


If any possiable to use 2 primary key in single table? How many primary key & foreign key used in each table(min & max)?

3 Answers  


How to select all columns of all rows from a table with a select statement in ms sql server?

0 Answers  


What are three ways you can use an identity value inside a trigger? Why would you prefer one way over another?

0 Answers  


What is raid and what are different types of raid levels?

0 Answers  


what is package configuration variable?How to change file name in folder dynamically?Plz help me

1 Answers  


you added a row to a view, but the row is not shown on the view. Explain how this can happen, and how you can remedy the situation

0 Answers  


What is meant by indexing?

0 Answers  


Categories