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.
⇒ SQL Server Transact-SQL Language References
⇐ Statement Batch in SQL Server Transact-SQL
2017-05-29, 2617🔥, 0💬
Popular Posts:
How To Recover a Dropped Index in Oracle? If you have the recycle bin feature turned on, dropped ind...
How to set the current database in SQL Server? Once you are connected to the SQL Server, you should ...
Where to find answers to frequently asked questions on Storage Engines: MyISAM, InnoDB and BDB in My...
What Are Date and Time Functions in MySQL? MySQL offers a number of functions for date and time valu...
How to set database to be READ_ONLY in SQL Server? Databases in SQL Server have two update options: ...