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

What is the page size in SQL Server?

NOTE: This is objective type question, Please click question title for correct answer.
Will COUNT(column) include columns with null values in its count?

NOTE: This is objective type question, Please click question title for correct answer.
How can we Rollback the Transaction in DataBase?

We can Rollback the Transaction using "ROLLBACK TRANSACTION" Command
How Can we Write the Transaction Block in SQL Server?

BEGIN TRANSACTION

Statement 1
Statement 2
..................
...............
IF(@ERROR>0)
ROLLBACK TRANSACTION
ELSE
COMMIT TRANSACTION
Difference Between Truncate Table and Delete Table Command in SQL Server?

In case of Delete Statement Log is maintained. while in case of truncate command log is not maintained for each row, so we can't rollback the data in case of truncate table command.
Which is the best method to get the single value from Database?

NOTE: This is objective type question, Please click question title for correct answer.
Unique Key is smilar to Priamary Key,except it

NOTE: This is objective type question, Please click question title for correct answer.
Which type of datatype is used to store IO Streams in Sql Server?

NOTE: This is objective type question, Please click question title for correct answer.
Which Statement describe the COALESCE ?

NOTE: This is objective type question, Please click question title for correct answer.
A table can have maximum of 1024 partitions.

NOTE: This is objective type question, Please click question title for correct answer.
What is 'NEXT USED' in SQL Server ?

The filegroup will accept a new partition that is created by using an ALTER PARTITION FUNCTION statement.
How do you determine the maximum nested-level of Stored Procedure ?

The current nested level can be determine by : @@NESTLEVEL, The maximum nested level is 32 .

ie:
1. Creating stored procedure :
CREATE PROC PROC_SAMPLE1

AS
BEGIN
PRINT @@NESTLEVEL
EXEC PROC_SAMPLE1
END

2. Executing stored procedure :
EXEC PROC_SAMPLE1

3. Result :
1
2
3
..
..
32
Msg 217, Level 16, State 1, Procedure PROC_SAMPLE1, Line 5
Maximum stored procedure, function, trigger, or view nesting level exceeded (limit 32).
Which Function is used to count more than two billion rows in a table?

NOTE: This is objective type question, Please click question title for correct answer.
Which of the following is a fixed length DataType?

NOTE: This is objective type question, Please click question title for correct answer.
SQL Server allows for only _____ levels of nesting in CASE expressions.

NOTE: This is objective type question, Please click question title for correct answer.
Is it possible to create Cluster Index on Unique Key Column?

Unique key column by default creates a non-cluster index on the column. Primary key creates cluster index on the column. The only difference is Unique key column allows only one null value. So is it possible to have cluster index on Unique key column?

The answer is YES. Though Unique key allows null value but it still maintains the uniqueness of the column.
You cannot create an Index on a column of the following data type

NOTE: This is objective type question, Please click question title for correct answer.
All indexes will automatically get deleted(dropped) if the table is deleted?

NOTE: This is objective type question, Please click question title for correct answer.
How to get a row was inserted most recently in a table?

select top 1 * from tablename order by ColumnName desc

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