Top 12 Microsoft Sql Server Interview Questions And Answers

 

1) What is Microsoft SQL Server?

It is RDBMS developed by Microsoft with the primary function of storing and retrieving data as requested. Microsoft makes SQL Server available in multiple editions, with different feature sets and targeting different users.


2) What Is SQL Profiler?

It is a tool which allows system administrator to monitor events in the SQL server. This is mainly used to capture and save data about each event of a file or a table for analysis.


3) What are the two authentication modes in Microsoft SQL Server?

Following are the two authentication modes in Microsoft SQL Server:

● Windows Mode
● Mixed Mode


4) What are the differences between local and global temporary tables in Microsoft SQL Server?

Local temporary tables are visible when there is a connection, and are deleted when the connection is closed whereas global temporary tables are visible to all users, and are deleted when the connection that created it is closed.


5) What is CHECK constraint?

A CHECK constraint can be applied to a column in a table to limit the values that can be placed in a column. Check constraint is used to enforce integrity.


6) What is Microsoft SQL server agent?

The SQL Server agent plays a vital role in day to day tasks of SQL server administrator(DBA). Its purpose is to implement the tasks easily with the scheduler engine which allows the jobs to run at scheduled date and time.


7) What is COALESCE in Microsoft SQL Server?

COALESCE is used to return first non-null expression within the arguments. It is used to return a non-null from more than one column in the arguments.


8) How exceptions can be handled in Microsoft SQL Server Programming?

Exceptions are being handled using TRY CATCH constructs where scripts will be written inside the TRY block and error will be handled in the CATCH block.


9) Is it possible to check locks in database? If so, how this can be done?

Yes, locks cab be checked in the database. It can be achieved by using in-built stored procedure called sp_lock.


10) What is a Trigger?

Triggers are used to execute a batch of SQL code when insert, update or delete commands are executed against a table. Triggers are automatically executed when the data is modified.


11) What are the different type of Triggers?

Following are the different type of triggers:

● Insert
● Delete
● Update
● Instead of


12) What is the system function to get the current user's userid?

USER_ID() is the system function which is used to get the current user's userid.


 

Related links: