In Transact-SQL, the semicolon statement terminator is in most cases optional. Therefore many developers don't use semicolons. However, in some situations missing semicolons may yield insidious errors.
Semicolons are required by the ANSI standard, and Microsoft https://docs.microsoft.com/en-us/sql/t-sql/language-elements/transact-sql-syntax-conventions-transact-sql[recommends] the consistent usage of semicolons and might make semicolons mandatory in a future version of SQL Server. Also, semicolons make the code more portable.
=== on 7 Apr 2017, 11:25:52 Pierre-Yves Nicolas wrote:
Not sure this should be a "bug detection" rule. That's the worst case but it's probably rare. The example code comes from \http://www.dbdelta.com/always-use-semicolon-statement-terminators/