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 Select Some Specific Rows from a Table in MS SQL Server? |
☺ | How To Start SQL Server Browser Service? |
☺ | What Happens If You Insert a Duplicate Key for the Primary Key Column in MS SQL Server? |
☺ | What Are Binary String Data Types in MS SQL Server? |
☺ | Can You Roll Back the DDL Statement in a Trigger? |
Top Databases Programming Categories
☺ | RDBMS Interview Questions. |
☺ | SQL Interview Questions. |
☺ | SSRS Interview Questions. |
☺ | Database Administrator (DBA) Interview Questions. |
☺ | Sybase Interview Questions. |