SA0078 : Statement is not terminated with semicolon
The topic describes the SA0078 analysis rule.
Statement is not terminated with semicolon
The rule checks for statements not terminated with semicolon.
Consider terminating all statements with semicolon to improve readability and compatibility with future versions of SQL Server.
As more and more keywords, and statements are added to Transact-SQL, there will appear more cases where the semicolon terminator will be required.
The rule has a Batch scope and is applied only on the SQL script.
Rule has no parameters.
The rule does not need Analysis Context or SQL Connection.
Design Rules, Deprecated Features, Code Smells
There is no additional info for this rule.
1-- Create procedure to retrieve error information. 2CREATE PROCEDURE usp_GetErrorInfo 3AS 4BEGIN 5 BEGIN TRY 6 -- Generate divide-by-zero error. 7 8 SELECT 1 / 0 9 END TRY 10 BEGIN CATCH 11 -- Execute error retrieval routine. 12 13 EXECUTE usp_GetErrorInfo -- gets error info 14 END CATCH; 15 16 BEGIN TRANSACTION; 17 18 IF @@TRANCOUNT = 0 19 BEGIN 20 ROLLBACK TRANSACTION 21 22 PRINT N'Rolling back the transaction two times would cause an error.' 23 END 24 25END
|1||SA0078 : Statement is not terminated with semicolon.||25||3|
|2||SA0078 : Statement is not terminated with semicolon.||8||21|
|3||SA0078 : Statement is not terminated with semicolon.||13||32|
|4||SA0078 : Statement is not terminated with semicolon.||23||7|
|5||SA0078 : Statement is not terminated with semicolon.||20||28|
|6||SA0078 : Statement is not terminated with semicolon.||22||77|