Do not indent BEGIN END

Answered

Current:

IF 1 = 1
  BEGIN
    SELECT 1
  END

Should be:

IF 1 = 1
BEGIN
  SELECT 1
END

Also DO NOT indent after BEGIN TRAN

Current

BEGIN TRAN T1
  DELETE FROM Users WHERE Id = 1
  DELETE FROM UserData WHERE Id = 1
COMMIT TRAN T1

Should be

BEGIN TRAN T1
DELETE FROM Users WHERE Id = 1
DELETE FROM UserData WHERE Id = 1
COMMIT TRAN T1

1 comment
Comment actions Permalink

Hello,

Which SQL dialect do you use?

0

Please sign in to leave a comment.