Not using a statement terminator – such as semicolon (;) for T-SQL statements is a deprecated feature in SQL Server. It’s a feature that will not be supported in a future SQL Server version – not as yet specified. For the DBA this raises the question of when and how to enforce this change.
Depending on the SQL Server environment there may be multiple SQL Server Instances , different groups of developers, supporting in-house and third party databases. All will probably have different levels of controls around coding the semicolon in sql
The semicolon is included in the ANSI SQL-92 standard. Before some recent features (more later) coding in T-SQL required no semicolon for parsing or execution. Most developers who implement code on servers I manage don’t feel it’s necessary to use a semicolon – they argue against the extra typing and no rule enforcement
Some arguments to convince SQL developers it’s time to start implementing the semicolon
1) When using a Common table Expression(CTE) and the CTE is not the first batch statement , it’s mandatory to use a semicolon
2) If a Service Broker statement is issued and the Service Broker statement is not the first statement in the batch a semicolon must be used.
3) If a MERGE statement is used , a semicolon must be used
4) Easier manageability of splitting code
5) Makes the code more transportable
6) Easier for an outside coder to understand the code breakdown
Let me know your opinion
Related Posts
SQL server – 5 things SQL Server developers should know about SQL Server
SQL Server Performance Killers
Stored Procedures versus ad-hoc paramaterized queries.Which is faster?