All fields

“Error Handling with TRY CATCH” in Information Technology

38 questions across 4 technologies.

Information Technology

38 questions in 4 technologies

#QuestionTechnologyTopicLevel
1How do you combine a TRY CATCH block with a transaction to ensure the database is properly rolled back if an error occurs partway through? SQL Server › Error Handling with TRY CATCHSQL ServerError Handling with TRY CATCHIntermediate
2What types of errors cannot be caught by a TRY CATCH block in SQL Server? SQL Server › Error Handling with TRY CATCHSQL ServerError Handling with TRY CATCHIntermediate
3How would you build a centralized, reusable error logging procedure that captures detailed error information whenever it is called from within a CATCH block? SQL Server › Error Handling with TRY CATCHSQL ServerError Handling with TRY CATCHAdvanced
4How does a TRY CATCH block work in SQL Server, and why is it useful? SQL Server › Error Handling with TRY CATCHSQL ServerError Handling with TRY CATCHBeginner
5What error information functions are available inside a CATCH block to help you understand what went wrong? SQL Server › Error Handling with TRY CATCHSQL ServerError Handling with TRY CATCHBeginner
6How do nested TRY CATCH blocks work, and when would you use them in a complex stored procedure? SQL Server › Error Handling with TRY CATCHSQL ServerError Handling with TRY CATCHAdvanced
7What is the difference between using THROW and RAISERROR to raise a custom error in SQL Server? SQL Server › Error Handling with TRY CATCHSQL ServerError Handling with TRY CATCHIntermediate
8What is the try/catch/finally pattern's 'finally' block used for, and how does it behave with async/await? Node.js › Error HandlingNode.jsError HandlingIntermediate
9How does a try catch block work in PHP, and how do you catch and handle a specific exception that might be thrown? PHP › Error & Exception HandlingPHPError & Exception HandlingBeginner
10How do you properly handle errors that occur during an asynchronous operation using a try catch block combined with async and await? Flutter › Dart Asynchronous Programming (Future & async/await)FlutterDart Asynchronous Programming (Future & async/await)Intermediate
11How would you design a stored procedure to handle a complex business process involving multiple steps, proper error handling, and transaction management together? SQL Server › Stored Procedures & FunctionsSQL ServerStored Procedures & FunctionsAdvanced
12How would you write a T-SQL script that combines variables, control flow, and error handling together to perform a robust, multi step administrative task? SQL Server › T-SQL Fundamentals & SyntaxSQL ServerT-SQL Fundamentals & SyntaxAdvanced
13How do you configure a job step to automatically retry if it fails, rather than immediately marking the entire job as failed? SQL Server › SQL Server Agent & Job SchedulingSQL ServerSQL Server Agent & Job SchedulingIntermediate
14How do you use a SAVE TRANSACTION savepoint within a larger transaction to allow partial rollback of just a portion of the work? SQL Server › Transactions & ACIDSQL ServerTransactions & ACIDIntermediate
15How do you check whether a transaction is currently active and view its properties within a session? SQL Server › Transactions & ACIDSQL ServerTransactions & ACIDIntermediate
16What error does an application receive when its transaction is chosen as a deadlock victim, and how should the application respond? SQL Server › DeadlocksSQL ServerDeadlocksIntermediate
17How would you design a complex SQL Server Agent job with multiple steps that need to run conditionally based on the success or failure of previous steps? SQL Server › SQL Server Agent & Job SchedulingSQL ServerSQL Server Agent & Job SchedulingAdvanced
18What is dynamic SQL, and why would you need to build and execute a SQL statement as a string rather than writing it directly? SQL Server › Dynamic SQLSQL ServerDynamic SQLBeginner
19What is a transaction in SQL Server, and why is grouping multiple statements into one important? SQL Server › Transactions & ACIDSQL ServerTransactions & ACIDBeginner
20What is a trigger in SQL Server, and what kinds of events can cause one to run automatically? SQL Server › TriggersSQL ServerTriggersBeginner
21What is T-SQL, and how does it relate to standard SQL? SQL Server › T-SQL Fundamentals & SyntaxSQL ServerT-SQL Fundamentals & SyntaxBeginner
22How do you prevent a recursive common table expression from running forever if the underlying data accidentally contains a circular reference? SQL Server › Common Table Expressions (CTEs)SQL ServerCommon Table Expressions (CTEs)Intermediate
23What is a check constraint, and how do you use one to enforce a specific business rule at the database level? SQL Server › Constraints (Primary Key, Foreign Key, Check & Unique)SQL ServerConstraints (Primary Key, Foreign Key, Check & Unique)Intermediate
24What are the basic steps required to declare, open, use, and properly clean up a cursor? SQL Server › CursorsSQL ServerCursorsIntermediate
25How do you debug a dynamic SQL statement when it fails or does not produce the expected results? SQL Server › Dynamic SQLSQL ServerDynamic SQLIntermediate
26What is a deadlock, and how does SQL Server automatically handle one when it occurs? SQL Server › Isolation & LockingSQL ServerIsolation & LockingIntermediate
27How do you test and verify that a linked server connection is working correctly after it has been configured? SQL Server › Linked ServersSQL ServerLinked ServersIntermediate
28How do you safely test a MERGE statement before running it against real production data? SQL Server › Merge Statement (Upsert)SQL ServerMerge Statement (Upsert)Intermediate
29How do you configure a SQL Server Agent job to send an email alert if it fails? SQL Server › SQL Server Agent & Job SchedulingSQL ServerSQL Server Agent & Job SchedulingIntermediate
30How do you use output parameters in a stored procedure to return a value back to the calling code, in addition to or instead of a normal result set? SQL Server › Stored Procedures & FunctionsSQL ServerStored Procedures & FunctionsIntermediate
31What is the difference between an implicit and an explicit transaction in SQL Server? SQL Server › Transactions & ACIDSQL ServerTransactions & ACIDIntermediate
32Why should triggers generally be designed to handle multiple affected rows at once rather than assuming only a single row was changed? SQL Server › TriggersSQL ServerTriggersIntermediate
33How do you capture detailed information about deadlocks that are happening on a server so you can investigate their root cause? SQL Server › DeadlocksSQL ServerDeadlocksIntermediate
34How would you add a new constraint to an existing table that already contains data, especially if some existing rows might violate that constraint? SQL Server › Constraints (Primary Key, Foreign Key, Check & Unique)SQL ServerConstraints (Primary Key, Foreign Key, Check & Unique)Advanced
35How would you validate that a value stored in a column actually contains well formed JSON before allowing it to be inserted or updated? SQL Server › JSON Support in SQL ServerSQL ServerJSON Support in SQL ServerAdvanced
36How would you troubleshoot a transactional replication setup where a subscriber has stopped receiving new changes entirely? SQL Server › ReplicationSQL ServerReplicationAdvanced
37How would you design an Extended Events session to monitor for a very specific, hard to reproduce issue, such as intermittent deadlocks, in a production environment? SQL Server › SQL Server Profiler & Extended EventsSQL ServerSQL Server Profiler & Extended EventsAdvanced
38How do nested and recursive triggers work in SQL Server, and what precautions should be taken to avoid unexpected behavior or infinite loops? SQL Server › TriggersSQL ServerTriggersAdvanced