This article is half-done without your Comment! *** Please share your thoughts via Comment ***
In my overall career, I worked on multiple RDBMS/NoSQL systems. As per the ANSI SQL, SQL statements are terminated by semicolons. If you are working on MySQL or PostgreSQL then a semicolon is a mandatory between multiple SQL statements.
Most of the SQL Server DB guys are confused between “GO” and semicolon. “GO” is a default identifier which uses as a batch separator where a semicolon is a terminator of a SQL Statement.
The semicolon is a not a mandatory in SQL Server because by default SQL statements are terminated with semicolons.
But we must terminate the statement by using the semicolon which is the best practice.
In some cases, I got a wrong error message for those SQL Statements which are not ended by semicolons.
If you are a programmer and know the C, C++ or JAVA, you know that statement terminator is mandatory for the compiler.
Microsoft technologies are good, but they are changing and upgrading their versions very speedy. So in the future, there may be a chance of announcement like “Semicolon as a statement terminator is compulsory in SQL Server”, and after that, you can assume what will happen. You have to update all your DB Codes.
I would suggest, please don’t wait for anything and give explicitly semicolon at the end of your SQL Statement.
Leave a Reply