Columns

How to work with columns in SqlDBM

SqlDBM Support avatar
Written by SqlDBM Support
Updated over a week ago

Columns are the building blocks of database tables. A column has a name and a datatype. Primary key columns have a "Not NULL" constraint enabled by default.

Create column

You can create columns in the following ways:

• Through table edit mode.

Enter edit mode by double-clicking on your table or pressing the Enter key once a table is selected. Enter the column name and datatype (and length) in the inputs. Select the"Not Null" constraint if applicable.

Columns that are represented above the solid line will be created as primary keys.

• In table properties

Click the "Plus" icon in the "Columns" section of the table properties. Enter the column details.

• By table context menu

Click the "Add Column" option

• By column context menu in Database Explorer

Click the "Create new" option

Move and copy a column

For moving columns between tables, select the column (Ctrl+Click to select multiple) in the table and drag it to the target table.

Columns can also be copied.

You can use it both for a table and between tables.

Press the "Ctrl" key while dragging to Copy (otherwise the action will move the columns).

Common properties

Click on a column in Database explorer, column name on the diagram, or column name in table properties.

Column

See the following options for the Column tab:

• Logical name

• Name

• Datatype

• Allow nulls checkbox

Create a logical name for the top-level design of your project. Use logical view mode to set it. If you create some logical name for a column, the physical name will be automatically generated according to Naming convention rules. See details in the Logical modeling article.

You may set the physical name in the Name input. Use the override button to inherit the physical name from the logical name.

Remember that the "Naming Conventions" option can help keep column names consistent for the whole team across the entire project.

Add data type manually or using autocomplete.

NULLs

To restrict null values in a column, a "NOT NULL" constraint can be applied. Use the "Allow Nulls" checkbox to have SqlDBM generate or drop this constraint. By default, primary key columns have the constraint applied and the checkbox is unmarked.

Options

Option tab may contain different values depending on your DB/DW type.

The default value (Snowflake)

Collation (Snowflake and Azure Synapse Analytics)

Sequences and Identity (Snowflake) for numeric data types

Constraints

Default constraint (Azure Synapse Analytics)

Default constraint. name (Azure Synapse Analytics)

Description

A functional description which is converted to an SQL comment upon Forward Engineering

See also:

Did this answer your question?