Win Surprise Gifts!!!
Top 5 Contributors of the Month
Post New Question
Subscribe to Interview Questions
Difference between Store Procedure and function?
Posted By :
Posted Date :
July 22, 2011
S.No Store Procedure Function
1. Return Null or Value Return Value
2. Input,OutPut Parameter Input Parameter
3. Call independently Call SQL Statement
4. Not called from Function Called from Procedure
You can also find related Interview Question to
Difference between Store Procedure and function?
whats the difference between a stroed procedure and a user defined function
udf ll return only one output parameter where as sp returns more(2100 not sure)
udf are called directly by their name in a pgm where as exec spname
is used to execcute an sp
Difference between Function and Stored Procedure?
UDF can be used in the SQL statements anywhere in the WHERE/HAVING/SELECT section where as Stored procedures cannot be.
UDFs that return tables can be treated as another rowset. This can be used in JOINs with other tables.
Inline UDF's can be though of as views that take parameters and can be used in JOINs and other Rowset operations.
What is Difference between Function and Stored Procedure?
UDF can be used in the SQL statements anywhere in the WHERE/HAVING/SELECT section where as Stored procedures cannot be. UDFs that return tables can be treated as another rowset. This can be used in JOINs with other tables. Inline UDF's can be thought of as views that take parameters and can be used in JOINs and other Rowset operations.
Database: Difference between Function and stored procedure?
Function can be used in sql statements anywhere in where/select/having etc. where as stored procedure cannot be.
Difference between stored procedure and function
1.Function must return a value but Stored Procedure can return 0(Zero) or n values
2.Functions have only input parameters but Procedures can have either input or output or both parameters .
3.Function must have one input parameter which is mandatory but 4.Stored Procedure may take 0 (Zero) to n input parameters.
5.Functions can be called from Procedure whereas Procedures cannot be called from Function.
6.Procedure contains DML statement whereas function allows only select statement.
6.Exception handling can be done in stored Procedure only
What is the difference between stored procedure and function.
Below is main differences between two.
1) Procedure can return zero or n values whereas function can return one value which is mandatory.
2) Procedures can have input, output parameters for it whereas functions can have only input parameters.
3) Procedure allows select as well as DML statement in it whereas function allows only select statement in it.
4) Functions can be called from procedure whereas procedures cannot be called from function.
5) Exception can be handled by try-catch block in a procedure whereas try-catch block cannot be used in a function.
6) We can go for transaction management in procedure whereas we can't go in function.
7) Procedures cannot be utilized in a select statement whereas function can be embedded in a select statement.
Difference between a sub and a function.
A Sub Procedure is a method will not return a value
-A sub procedure will be defined with a "Sub" keyword
Sub ShowName(ByVal myName As String)
Console.WriteLine("My name is: " & myName)
-A function is a method that will return value(s).
-A function will be defined with a "Function" keyword
Function FindSum(ByVal num1 As Integer, ByVal num2 As Integer) As Integer
Dim sum As Integer = num1 + num2
Maximum number of parameters you can pass in a Store procedure in SQL Server 2005?
What is the difference between "dynamic SQL" and "stored procedure" ?
Dynamic sql is the bunch of statements that dynamically constructed at run time and not stored in database.
Where as Stored procedures are stored in data base in complied form.
Main Difference between Method and function?
Method which tied to a class where as function need not to be. In OOPS we can say there is no functions concept because all the method is tied to a class.
Difference between Len and DataLength function in Sql Server?
LEN() function will not count the trailing spaces.
DATALENGTH() function will count the trailing function
DECLARE @MyString VARCHAR(50)
SET @MyString = 'alwyn '
SELECT LEN(@MyString) AS LenFunction
SELECT DATALENGTH(@MyString) AS DataLength
Database: Difference between stored procedure and trigger?
.Stored procedure are called explicitly where as trigger are called implicitly.
.Stored procedure are not attached to specific table where as triggers are attached to specific table.
.Stored procedure are called by invoking a CALL to it where this does not applies in case of trigger.
what is store Procedure(SP)?
Its nothing but a set of T-SQL statements combined to perform a single task of several tasks.
What is the Difference between subroutine and function In VB Script
Function Should Return a Value
Subroutine does not return any Value
Quick Links For Interview Questions Categories:
Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.
So, Start looking our
section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.
Hall of Fame
Terms of Service
Tell A Friend