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                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
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 ?    0 Yes 0 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 ?    0 Yes 0 No
Selvaraj.v
 
 
 

 
 
 
Other SQL Server Interview Questions
 
  Question Asked @ Answers
 
What is the difference between windows authentication and sql server authentication HCL3
what is the difference between sql query and google query? TCS2
How do you measure the performance of a stored procedure? Infosys1
How do SQL server 2000 and XML linked?  1
how to rest identity columns in sql server Matrix2
How to determine the service pack currently installed on SQL Server? HCL2
What are the pros and cons of creating extended stored procedures?  1
what are three different authentications to connect linked servers? CitiGroup1
any one can explain Self mapping Delegation Remote Credentials  1
What is a transaction and what are ACID properties? IBM2
what is maximum size of temp db? iSoft3
What's the difference between DELETE TABLE and TRUNCATE TABLE commands?  6
What is the difference between OLEDB and ODBC CFCI2
Say if we have a table that contains only a single column , say OrderID, which has IDENTITY attribute defined on it. So how can we insert data in this table. I am reframing my question, that how can we make the table to increment the column "OrderID" value several times???  3
wat is the main diff between sql server 2000and sql server 2005 Jade-Software4
which query u can write to sql server doesn't work inbetween 7.00PM to nextday 9.00AM Wipro4
HOW TO FIND THE EMPLOYEE DETAILS WHO ARE GETTING SAME SALARY IN EMP TABLE TCS14
Which data type can be used only on OUTPUT parameters of the stored proceduer?  2
Difference between sql server 2000 and sql server 2005? Satyam2
What is the purpose of using COLLATE in a query?  1
 
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