Altova DatabaseSpy 2025 Enterprise Edition

You can add columns to an existing table from the Online Browser, the Design Editor, or by generating SQL (see details below). To rename columns, see Renaming Database Objects. To drop columns, see Dropping Database Objects.

 

From the Online Browser

1.Right-click a table (or the "Columns" folder of a table) and select Create Column from the context menu. The new column appears in the Online Browser with the default name "column", and a structure change script is generated in the Database Structure Change Script Window.

dbs_create_column_online_browser

2.Select the new column and press F2 to rename it. Alternatively, right-click the column and select Rename from the context menu.

3.Set the column's properties (such as Type or Nullable) from the Properties Window. Note that the available column properties vary by database kind. If the table is empty or new (not yet committed to the database), the new column is NOT NULL by default.

4.Click the Execute Change Script dbs_ic_execute_script button in the Database Structure Change Script window.

 

From the Design Editor

1.On the File menu, click New | Design Editor, or press Ctrl+D.

2.Do one of the following:

 

Select the table and run the menu command Design Editor | Create New Column.

Press Alt+C.

Right-click the table and select Insert new | Column from the context menu.

Click the plus ic_add-column icon to the right of the last column name.

 

The column is inserted into the table design and a New ic_new-column icon appears to the left of the column name.

 

3.Enter a descriptive name for the column and press Enter.

4.Modify the column properties as required.

5.Click the Execute Change Script dbs_ic_execute_script button in the Database Structure Change Script window.

To duplicate columns from other tables:

1.Select the column to be duplicated in the Online Browser or in the Design Editor and, keeping the mouse button pressed, drag it into the Columns section of the table design where you wish to add the column.

2.Edit the column properties and/or the column name.

3.Click the Execute Change Script dbs_ic_execute_script button in the Database Structure Change Script window.

 

 

By generating SQL

1.In the Online Browser, right-click the column that serves as a model for the new column to be created.

2.Select the menu command Show in new SQL Editor | Add from the context menu.

3.In the SQL Editor, change the column name and edit the column definition, if required.

4.Click the Execute dbs_ic_execute_query button or press F5.

© 2018-2024 Altova GmbH