SQL Server Advanced Concepts
Advanced SQL Server topics including DCL, system functions, CTEs, configuration settings, triggers, data types, transactions, and error handling.
Questions
@@Error returns the sys.messages.message_id column value if an error occurs in the last T-SQL statement executed.True/False?
- True
- False
A transaction must have ACID properties to be qualified as such.
- True
- False
Which of the Isolation levels causes "Dirty Read"?
- Read Uncommitted
- Read Committed
- Repeatable Read
- Snapshot
- Serializable
Which one of the below functions is Non-Deterministic?
- CASE
- ISNULL
- ISNUMERIC
- ISDATE
- None
The given T-SQL statement is executed. What happens?
- A run time error occurs
- Returns all the column names in the table but no records
- Returns all the records in the table
- Returns nothing
- Returns NULL
COUNT(*) returns the number of items in a group - which of the below is correct?
- This includes NULL values and duplicate
- This includes NULL values but not the duplicates
- This does not include NULL values and duplicates
- None of the above
sys.sql_modules system catalog contains a row for each object of type P, RF, V, TR, FN, IF, TF, R, and D.
- True
- False
We can write triggers for Truncate.
- True
- False
Extended Stored Procedure master.dbo.xp_fileexist can be used to decide if a file exists.
- True
- False
If DBCC CHECKDB for a database then DBCC CHECKALLOC has to be run separately.
- True
- False
MARS stands for:
- Multiple Active Record Sets
- Multiple Active Result Sets
- Multiple Account Record Sets
- Multiple Account Result Sets
There must be at least one log file for each database.
- True
- False
SQL 2005 XML data type instance storage has a limit. Choose the correct limit:
- 1 GB
- 1024 KB
- 2 GB
- 500 MB
A trigger name in SQL 2005 cannot start with #.
- True
- False
Which one of the below, returns the maximum number of simultaneous user connections allowed on an instance of SQL Server?
- @@MAX_CONNECTIONS
- @@TRANCOUNT
- @@CONNECTIONS
- None of the above
Choose the correct option:
- When SET ANSI_NULLS is OFF, comparisons of all data against a null value evaluate to UNKNOWN if the data value is NULL
- When SET ANSI_NULLS is OFF, comparisons of all data against a null value evaluate to UNKNOWN if the data value is NOT NULL
- When SET ANSI_NULLS is OFF, comparisons of all data against a null value evaluate to FALSE if the data value is NULL
- When SET ANSI_NULLS is OFF, comparisons of all data against a null value evaluate to TRUE if the data value is NULL
Choose the correct option:
- A CTE is created using the WITH statement
- A CTE is created using the SELECT statement
- A CTE is created using the CREATE statement
- None of the above
Which of the below is used to get the system lock information?
- sp_who
- sys.dm_tran_locks
- @@lock_timeout
- sp_lock
- None of the above
Which of the below is a part of Data Control Language?
- SELECT
- DENY
- APPLY
- UPDATE
- None of the above