Sql Server Interview Questions and Answers (1758) - Page 71

When does Trigger fire?

NOTE: This is objective type question, Please click question title for correct answer.
When does Triggers NOT fire?

NOTE: This is objective type question, Please click question title for correct answer.
What is the output of below query? select * from test1 t1 inner join test2 t2 on t1.ID = t2.ID where t1.ID <> t2.ID;

NOTE: This is objective type question, Please click question title for correct answer.
What is the exact use of Logical Tables in Sql Server?

As we know that,Logical Tables are created when we do any operations like Insert,Update and delete on Tables.
Basically,Logical Tables are used by Triggers for the following reason:-
1). To test data manipulation errors and take suitable actions based on the errors.
2). To find the difference between the state of a table before and after the data modification and take actions based on that difference.
3). To insert,update or delete records in another tables based on this tables.
How to execute Dynamic Stored Procedure or Dynamic Queries?

NOTE: This is objective type question, Please click question title for correct answer.
Which statement is correct concerning Primary Key?

NOTE: This is objective type question, Please click question title for correct answer.
Which statement is correct concerning Unique Key?

NOTE: This is objective type question, Please click question title for correct answer.
Which statement is correct concerning Foreign key?

NOTE: This is objective type question, Please click question title for correct answer.
Which way is used to assign Alias Name to columns in Sql Server?

NOTE: This is objective type question, Please click question title for correct answer.
What is the use of Default keyword in Sql Server?

Default keyword is used for setting default value to any columns so that whenever any record is inserted in table,that column will also have a value.We do not need to pass column
name in Insert statement.We generally give default value for date related columns,boolean or bit columns where we have Yes and No value and so on.

For Example:-
CREATE TABLE Test

(
Test_Id int identity,
Test_Name Nvarchar(50),
Created_Date SmallDatetime default getdate(),
Is_Active bit default 'N'
)

Which statement is/are correct about Dynamic Queries?

NOTE: This is objective type question, Please click question title for correct answer.
Which statement is correct about Index in Sql Server?

NOTE: This is objective type question, Please click question title for correct answer.
Which statement is correct about Cross Joins?

NOTE: This is objective type question, Please click question title for correct answer.
Which statement is correct about Self Joins?

NOTE: This is objective type question, Please click question title for correct answer.
Which is the correct syntax to create an Index on column?

NOTE: This is objective type question, Please click question title for correct answer.
What is wrong with below Sql Queries? SELECT ID FROM TEST1 UNION ALL SELECT * FROM TEST2

It will give error as

Msg 205, Level 16, State 1, Line 1
All queries combined using a UNION, INTERSECT or EXCEPT operator must have an equal number of expressions in their target lists.I means mis-match in the No of Columns in the select queries combined by the UNION Operator. In Union/Union All,No of columns must be the same.

What are the different Authentication Modes in Sql Server?

NOTE: This is objective type question, Please click question title for correct answer.
Which is the correct statement for creating Unique Index?

NOTE: This is objective type question, Please click question title for correct answer.
Which is the correct syntax to create an Unique index on Tables?

NOTE: This is objective type question, Please click question title for correct answer.
Where do Local and Global Temporary tables Reside?

NOTE: This is objective type question, Please click question title for correct answer.
Found this useful, bookmark this page to the blog or social networking websites. Page copy protected against web site content infringement by Copyscape

 Interview Questions and Answers Categories