SQL Server Interview Question and Answers

26. What are the types of database recovery models?
  • Full
  • Simple
  • Bulk Logged
27. What the difference between UNION and UNIONALL?
  Union will remove the duplicate rows from the result set while Union all does’nt.
28. What is the building block of a relational database?
  The table
29. What is the difference 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.
30. What is the difference between a local and a global variable?
  A Local temporary table exists only for the duration of a connection or, if defined inside a compound statement, for the duration of the compound statement.
A Global temporary table remains in the database permanently, but the rows exist only within a given connection. When connection are closed, the data in the global temporary table disappears. However, the table definition remains with the database for access when database is opened next time.

Page 6 of 15