What Happens to a Statement Batch If There Is a Compilation Error?
Submitted by: AdministratorIf 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.
Submitted by: Administrator
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.
Submitted by: Administrator
Read Online MS SQL Server Job Interview Questions And Answers
Top MS SQL Server Questions
☺ | How To Start SQL Server Browser Service? |
☺ | Does Index Slows Down INSERT Statements? |
☺ | What Is a Transact-SQL Statement Batch in MS SQL Server? |
☺ | How To Execute the Cursor Queries with "OPEN" Statements? |
☺ | What Happens If Strings Are Casted into Wrong Code Pages in MS SQL Server? |
Top Databases Programming Categories
☺ | RDBMS Interview Questions. |
☺ | SQL Interview Questions. |
☺ | SSRS Interview Questions. |
☺ | Database Administrator (DBA) Interview Questions. |
☺ | Sybase Interview Questions. |