Collections:
Compilation Error in a Statement Batch in SQL Server
What happens to a Transact-SQL statement batch if there is a compilation error?
✍: FYIcenter.com
If a Transact-SQL statement batch has multiple statements, and one of them has compilation error, none of the statements in the batch will be executed. The tutorial exercise below gives you some good examples:
SELECT getdate(); SELECT getdates(); SELECT getdate(); ---------------------------- 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.
Â
2017-05-29, 1273👍, 0💬
Popular Posts:
How To Generate Random Numbers with the RAND() Function in SQL Server Transact-SQL? Random numbers a...
Where to find MySQL database server tutorials? Here is a collection of tutorials, tips and FAQs for ...
What is test testing area for? The testing area is provided to allow visitors to post testing commen...
How to run Queries with SQL Server Management Studio Express in SQL Server? 1. Launch and connect SQ...
Where to find answers to frequently asked questions I am new to Oracle database. Here is a list of f...