Skip to main content

Spacing and Indents

For tabs, all spacing should be 4 spaces:

Correct
CREATE TABLE ExampleTable (
→→→→MyColumn VARCHAR(255) NOT NULL,
→→→→ExampleText INT NOT NULL
);
Wrong
CREATE TABLE ExampleTable (
→→MyColumn VARCHAR(255) NOT NULL,
→→ExampleText INT NOT NULL
);

All statements after a column name should have a space before parentheses, but not after:

Correct
CREATE TABLE ExampleTable (
MyColumn VARCHAR(255) NOT NULL CHECK (1 == 1),
ExampleText INT NOT NULL CHECK (1 == 1)
);

There is a space before the parentheses, after the CHECK keyword.

Wrong
CREATE TABLE ExampleTable (
MyColumn VARCHAR(255) NOT NULL CHECK(1 == 1),
ExampleText INT NOT NULL CHECK(1 == 1)
);

There is no space before the parentheses, after the CHECK keyword.

Wrong
CREATE TABLE ExampleTable (
MyColumn VARCHAR(255) NOT NULL CHECK (1 == 1) ,
ExampleText INT NOT NULL CHECK (1 == 1)
);

There is a space after the parentheses.

Wrong
CREATE TABLE ExampleTable (
MyColumn VARCHAR(255) NOT NULL CHECK ( 1 == 1 ),
ExampleText INT NOT NULL CHECK ( 1 == 1 )
);

There is in the start and end of the parentheses.

Wrong
CREATE TABLE ExampleTable (
MyColumn VARCHAR(255) NOT NULL CHECK (1==1),
ExampleText INT NOT NULL CHECK (1==1)
);

But, there should be space in the middle of the parentheses, so instead of CHECK (1==1), use CHECK (1 == 1).