Manage tables

This topic describes how to create and manage tables from Database Explorer.

Create a table

1. Right-click a table or the Tables node and select New Table.

2. In Table Designer, configure the table settings.

3. In the bottom panel, click Apply Changes.

Edit a table

1. Right-click the table you want to edit and select Open Editor.

2. In Table Designer, update the table settings.

Note

You can’t change the schema of an existing table in Table Designer. To use a different schema, move the table to that schema.

3. In the bottom panel, click Apply Changes.

Delete a table

1. Right-click the table you want to delete and select Delete, or press Delete.

2. Click Yes to confirm the deletion of the table.

Note

You cannot undo the drop table operation, because it permanently deletes the table structure and all table data. To avoid data loss, back up the database before deleting the table.

View and edit table data

1. Right-click the table whose data you want to view and manage, then select Open Data in Editor or Select All Rows.

Alternatively, select Open Editor and switch to the Data tab.

Note

The Select All Rows option retrieves data and displays it in a new SQL document.

2. On the Data tab of Table Designer, click the cell, enter a new value, then press Enter.

3. Optional: To perform any action on the data, right-click the selected row and select the required option from the shortcut menu.

For more information, see Work with data in Data Editor.

Retrieve data

To retrieve data from the selected table, right-click it and select Select All Rows.

Truncate a table

1. Right-click the table from which you want to delete all data and select Truncate Table.

2. Click Yes to confirm truncating the table.

Note

You cannot undo the truncate table operation, as this action permanently deletes the table data. To avoid data loss, back up the database before deleting the table.

Rename a table

1. Right-click the selected table and select Rename.

2. Specify the new table name, then press Enter.

3. Click Yes to confirm the renaming of the table.

Duplicate a table

1. Right-click the required table and select Duplicate Object.

2. In the Duplicate Object dialog, configure the object settings:

  • In Destination connection, select the target server.
  • In Destination database, select the target database.
  • In Destination schema, select the target schema.
  • In New object name, enter the object name.
  • Select Copy data to copy the table with the data.
  • Select Drop destination object to drop the destination object if it already exists. The data in the destination table will be lost.
  • Optional: Select Script Changes, then select To New SQL Window to open the generated script in a new SQL document, or To Clipboard to copy it to the clipboard.

3. Click OK.

Find an object

1. Right-click the database where you want to search for an object and select Find Object, or press Ctrl+D, F.

2. In the Search dialog, switch to the Search objects by name and DDL mode and enter the search string.

3. Follow the steps in How to search for database objects.

Refresh the table

To refresh the table and show the latest changes, right-click the table or Tables node and select Refresh, or press F5.

Open the Properties pane

To open the Properties pane, right-click the table and select Properties, or press F4.

Filter tables

1. Right-click the Tables node and select Filter.

2. In the Filter Settings dialog, configure the filter parameters.

3. Click OK to apply the filter.

Note

When you expand the Tables node, the number of tables appears in parentheses next to the node name. This number changes based on the applied filter.