Can you give an example of Stored Procedure?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
What are the advantages of partitioning?
Write a program to fetch first 10 records from a file?
How to convert a table data in XML format in sql server?
What is policy based management (pbm)? : sql server database administration
What is table level trigger?
What is a mutating table error and how can you get around it?
Is it possible to update the views? If yes, how, if not, why?
How to update values in a table with update statements in ms sql server?
Explain indexing and what are the advantages of it?
Can we call a function that has out parameter in select statement
Why it is recommended to avoid referencing a floating point column in the where clause?
After the SQL installation what are the jobs will you configure?
1 Answers G7 CR Technologies, IBM, Satyam,
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)