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
1.what are diff types of joins , and explain diff between cross join and full outer join 2.diff types of views 3. Diff types of index 4. What is diff b/w stores procedure and function procedure 5.diff between double and int in SQL 6.diff between char and varchar in SQL. 7.Oracle or SQL whice you will preferred and why.
What are system databases in ms sql server?
What is lookup override?
What is filestream?
what is the difference between them (ethernet networks and token ring networks)? : Sql server database administration
Which are the two editions in which SQL Azure database available?
Why would you use sql agent?
What are the disadvantages of merge replication?
What is a ddl statement?
What the different components in replication and what is their use?
What is the optimal disk configuration for a database server and what raid configurations would you use if budget is not a constraint?
What stored procedure would you use to view lock information?
What triggers long term care?
What’s the use of custom fields in report?
Define model database?