- Difference between CROSS APPLY and OUTER APPLY in SQL Server
- Understanding a SQL Server execution plan
- difference between function and stored procedure
- how to apply indexes in sql server
- how to apply cursors in sql server
- how to pass authentication token in header
- select sum(CustomerID) from Customer
- how to set outproc session in asp.net
- How to improve SQL Server database performance
- Improve SQL Query Performance.
- Avoid Multiple Joins in a Single Query. ...
- Eliminate Cursors from the Query. ...
- Avoid Use of Non-correlated Scalar Sub Query. ...
- Avoid Multi-statement Table Valued Functions (TVFs) ...
- Creation and Use of Indexes. ...
- Understand the Data. ...
- Create a Highly Selective Index.
Ø Stored
procedure can have input and output parameters.
Ø Function allow only input parameters,
doesn’t support output parameters.
Ø Stored
procedures cannot be called from Function.
Ø Function
can be called from Procedure.
Ø Stored
procedure allows SELECT as well as DML(INSERT/UPDATE/DELETE) statements.
Ø Function
allows only SELECT statement, we cannot use DML statements in Function.
Ø Stored
procedure cannot be called from Select/Where/Having and so on statements. Execute
or Exec statement can be used to call or execute Stored Procedure.
Ø Function
can be called from select statement.
Ø Exception
can be handled by try-catch block in a stored procedure.
Ø try-catch
block cannot be used in a Function.
Ø We
can use transactions within stored procedure.
Ø Transactions
are not allowed within Function.
Ø We
can use table variables as well as temporary tables in Procedure.
Ø We
can use only table variables in Function, temporary tables are not allowed.
No comments:
Post a Comment