ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
info       Did you received any Funny E-Mails from your Friends and like to share with rest of our friends? Yeah!! you can post that stuff   HERE
Google
 
Categories  >>  Software  >>  Databases  >>  SQL Server
 
 


 

 
 Oracle interview questions  Oracle Interview Questions
 SQL Server interview questions  SQL Server Interview Questions
 MS Access interview questions  MS Access Interview Questions
 MySQL interview questions  MySQL Interview Questions
 Postgre interview questions  Postgre Interview Questions
 Sybase interview questions  Sybase Interview Questions
 DB Architecture interview questions  DB Architecture Interview Questions
 DB Administration interview questions  DB Administration Interview Questions
 DB Development interview questions  DB Development Interview Questions
 SQL PLSQL interview questions  SQL PLSQL Interview Questions
 Databases AllOther interview questions  Databases AllOther Interview Questions
Question
What is the difference between Userdefined function and 
stored procedure? Explain and give the example also
 Question Submitted By :: Radhi
I also faced this Question!!     Rank Answer Posted By  
 
  Re: What is the difference between Userdefined function and stored procedure? Explain and give the example also
Answer
# 1
1. User defined functions can be used in select statements. 
Procedures can not be used.

2. Functions must return some value. Procedures do not 
always return the value.

3. Functions will take only input parameters. Procedures 
can take input as well as output parameters.

4. Not all types of user-defined functions use 
INSERT,UPDATE,DELETE statements(Only multi-statement table 
valued functions can use). All procedures can use these 
statements.
 
Is This Answer Correct ?    3 Yes 1 No
Ashwini
 
  Re: What is the difference between Userdefined function and stored procedure? Explain and give the example also
Answer
# 2
1.A stored procedure is a precompiled collection of 
Transact-SQL statements stored under a name and processed 
as a unit that you can call from within another Transact-
SQL statement or from the client applications.
2.Stored procedure performs an action.
3.A collection of SQL statements often combined with 
Control-of-flow statements.

1.User Defined Functions are compact pieces of Transact SQL 
code, which can accept parameters, and return either a 
value, or a table. They are saved as individual work units, 
and are created using standard SQL commands. Data 
transformation and reference value retrieval are common 
uses for functions.
 
Is This Answer Correct ?    4 Yes 0 No
Selvaraj.v
 
 
 
  Re: What is the difference between Userdefined function and stored procedure? Explain and give the example also
Answer
# 3
1. function always run with select command while stored 
procedure execute with execute command

2. function not provide output parameter facility
 while stored procedure provide output facility

3. function always execute means it execute more than one 
time while store procedure execute only one time
 
Is This Answer Correct ?    0 Yes 0 No
Manoj
 
  Re: What is the difference between Userdefined function and stored procedure? Explain and give the example also
Answer
# 4
Userdefined function can used in select statement.

It must return a values but in store procedure it is 
optional.

Store procedure can use using sqlparameter but in 
userdefined function it is not used.
 
Is This Answer Correct ?    0 Yes 1 No
Anil Sharma
 

 
 
 
Other SQL Server Interview Questions
 
  Question Asked @ Answers
 
Can Having clause be used without Group by clause? CTS4
I have to display ten columns values from diffrent ten tables. how many joins are require? HCL8
Name three version of sql server 2000 and also their differences?  1
Hi Can any one tell me the Good institute to learn SQL esp for Data Base Testing or SQL from scratch to the proficiency level in Hyederabad and facult also. Thankyou well in advance  6
What do u mean by orphan users, how will u list them in the DB IBM2
Is it possible to delete duplicate rows in a table without using a temporary table ?  6
Alternative way to DetDate() function?  4
What is the difference between windows authentication and sql server authentication HCL4
How to perfor If the table running time is taking 2hours and table is having 10 rows in it?  1
i want only duplicates rows from coloumn ex. emp_id(colomn name)1,1,2,3,3,4,5,5. so i want only duplicates no. iFlex2
What is RAID and what are different types of RAID configurations? Wipro5
What is user stored procedure & it purpose? Wipro3
After using delete statement in sql query to delete some records...to retrieve the deleted records we can get using rollback command but till that where it stores means particular location name i need....(after deleting and rollback ) iGate2
How many max. conditions can b written under the WHERE clause? Like select * from [tabnam] WHERE (cond1...or..cond2....or...cond3...and.....so on.....??? (upto how much extent))????? SAP-Labs2
how do we find every fifth record in a table  11
system date format is "yy-mm-dd" "select getdate()" ----> 2009-01-24 20:03:28.513 if i write "select dateadd(dd,2,getdate()) ".it returns "2009-01-26 19:59:38.340"...my question is dat could it be possible to retrive da date in da format "26 jan 2009 ...."??  8
what is advantages in sql 2005 over sql 2000?  4
what is diffence between replicaion and logshipping?  1
What is Covering Indexes? Plz explain with example  2
I have a table EMP in which the values will be like this EmpId Ename Sal DeptId 11 Ram 10000 10 11 Ram 10000 10 22 Raj 20000 20 22 Raj 20000 20 33 Anil 15000 30 33 Anil 15000 30 I want to delete only duplicate Rows. After Delete I want the output like this EmpId Ename Sal DeptId 11 Ram 10000 10 22 Raj 20000 20 33 Anil 15000 30 DELL10
 
For more SQL Server Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com