|
INTERVIEW QUESTIONS
DATABASE
MS SQL SERVER
DETAILS
Question: What Happens to a Statement Batch If There Is a Compilation Error?
Answer: If a statement batch has multiple statements, and one of them has compilation error, all statements in the batch will not be executed. The tutorial exercise below gives you some good examples:
SELECT getdate(); SELECT getdates(); SELECT getdate(); GO Msg 195, Level 15, State 10, Line 2 'getdates' is not a recognized built-in function name.
As you can see, the compilation error on the second statement stops the execution of all statements.
|
|
|
Category |
MS SQL Server Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.3) By 6577 users |
Added on |
9/23/2014 |
Views |
71201 |
Rate it! |
|
|
Question:
What Happens to a Statement Batch If There Is a Compilation Error?
Answer:
If a statement batch has multiple statements, and one of them has compilation error, all statements in the batch will not be executed. The tutorial exercise below gives you some good examples:
SELECT getdate(); SELECT getdates(); SELECT getdate(); GO Msg 195, Level 15, State 10, Line 2 'getdates' is not a recognized built-in function name.
As you can see, the compilation error on the second statement stops the execution of all statements. Source: CoolInterview.com
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
|
Related Questions |
View Answer |
|
What Is a Transact-SQL Statement Batch in MS SQL Server?
|
View Answer
|
|
How To Enter Comments in Transact-SQL Statements?
|
View Answer
|
|
How To Start and End Transact-SQL Statements?
|
View Answer
|
|
What Is a Transact-SQL Statement?
|
View Answer
|
|
What Is Transact-SQL Language?
|
View Answer
|
|
What Is SQL Language?
|
View Answer
|
|
Can Group Functions Be Used in the ORDER BY Clause in MS SQL Server?
|
View Answer
|
|
Can Multiple Columns Be Used in SQL GROUP BY Clause in MS SQL Server?
|
View Answer
|
|
How To Count Duplicated Values in a Column in MS SQL Server?
|
View Answer
|
|
How To Apply Filtering Criteria at Group Level with The HAVING Clause in MS SQL Server?
|
View Answer
|
|
How To Divide Query Output into Multiple Groups with the GROUP BY Clause in MS SQL Server?
|
View Answer
|
|
Can Group Functions Be Mixed with Non-group Selection Fields in MS SQL Server?
|
View Answer
|
|
How To Use Group Functions in the SELECT Clause in MS SQL Server?
|
View Answer
|
|
What Are Group Functions in Query Statements in MS SQL Server?
|
View Answer
|
|
How To Filter Out Duplications in the Returning Rows in MS SQL Server?
|
View Answer
|
|
Can SELECT Statements Be Used on Views in MS SQL Server?
|
View Answer
|
|
How To Count Rows with the COUNT(*) Function in MS SQL Server?
|
View Answer
|
|
How To Sort Query Output in Descending Order in MS SQL Server?
|
View Answer
|
|
Can the Query Output Be Sorted by Multiple Columns in MS SQL Server?
|
View Answer
|
|
How To Sort the Query Output with ORDER BY Clauses in MS SQL Server?
|
View Answer
|