Thursday, 4 April 2019

IQS

  1. Difference between CROSS APPLY and OUTER APPLY in SQL Server
  2. Understanding a SQL Server execution plan
  3. difference between function and stored procedure
  4. how to apply indexes in sql server
  5. how to apply cursors in sql server
  6. how to pass authentication token in header
  7. select sum(CustomerID) from Customer
  8. how to set outproc session in asp.net
  9. How to improve SQL Server database performance
    1. Improve SQL Query Performance.
    2. Avoid Multiple Joins in a Single Query. ...
    3. Eliminate Cursors from the Query. ...
    4. Avoid Use of Non-correlated Scalar Sub Query. ...
    5. Avoid Multi-statement Table Valued Functions (TVFs) ...
    6. Creation and Use of Indexes. ...
    7. Understand the Data. ...
    8. 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