Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...


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

Why and when do stored procedure recompile?

0 Answers  


Can you explain what are various ways to enhance the ssrs report?

0 Answers  


Explain the collation?

0 Answers  


Can a synonym name of a table be used instead of a table name in a select statement?

0 Answers  


what is the difference in login security modes between v6.5 and 7.0? : Sql server database administration

0 Answers  






How to rebuild all indexes on a single table?

0 Answers  


Is a primary key unique?

0 Answers  


Define magic tables in sql server?

0 Answers  


What is a view? is View updatable?

17 Answers   IBM, L&T,


When do you think a developer should use sql server-based cursors?

0 Answers  


How to handle errors in Stored Procedures. I want to display a message to the user in the .aspx page that is calling a stored procedure in it's code behind. please help me.

2 Answers   247Customer,


How can change procedure in sql server?

0 Answers  






Categories