Swapnil Sharma
Swapnil Sharma

Reputation: 23

Why use of semicolon is not necessary in sql server to terminate a statement?

I have a doubt in sql server which can be very basic or stupid for someone but i have the curiosity to know that why use of semicolon is not necessary to terminate the statement in sql server, that means how it comes to know that the statement has to be terminated at the particular point.

It would be great if anyone can help me knowing this.Thanks in advance

Upvotes: -1

Views: 564

Answers (1)

steoleary
steoleary

Reputation: 9298

Although not required in all cases, it is good practice to use them as the documentation states that they will be required in a future version, although it's been saying that for a long time, you might as well just use them.

T-SQL Syntax Conventions

Also, there are some instances where you do indeed need to terminate a statement with a semi-colon, such as directly preceding a CTE for example.

Upvotes: 2

Related Questions