0

SQL

Must you end all your commands with a semi-colon in SQL?

10th May 2018, 5:25 PM
Zechariah Ogunbusola
Zechariah Ogunbusola - avatar
3 Respostas
- 1
Yes. Just like: SELECT customer.* FROM customers customer;
10th May 2018, 5:26 PM
***
*** - avatar
0
The statement terminator is becoming a standard mechanism within T-SQL inside of SQL Server. In order to use Common Table Expressions (CTE), the preceding statement must be terminated with a semi-colon. Same thing goes for Service Broker calls. Looks like the THROW statement also needs a terminator before it can be used. Same goes with the MERGE statement. There are also other commands that work in odd ways without the terminator.
10th May 2018, 5:36 PM
MsJ
MsJ - avatar
0
It actually depends on the IDE. SQL Server can be set to “GO” as the terminator instead of the semi-colon Either avoid SkyNet
12th May 2018, 9:07 AM
SQrL
SQrL - avatar