Database objects

Database Explorer allows you to perform operations on multiple database objects simultaneously using the shortcut menu. Right-click the selected objects in Database Explorer to access commands for specific tasks, such as editing databases, tables, views, stored procedures, functions, triggers, and sequences, or activating and deactivating triggers.

Select multiple database objects

To select individual database objects, hold Ctrl while selecting the database object. To select a range of objects, hold Shift.

Note

To perform bulk operations, you must select multiple objects in Database Explorer.

Databases

Edit databases

To edit databases:

1. In Database Explorer, right-click the selected databases and select Edit Database.

2. dbForge Studio opens Database Editor for each selected database.

3. Make the changes.

Note

You cannot change the names of databases.

4. At the bottom of each Database Editor, select Apply Changes to save the database.

Manage multiple databases using the shortcut menu

The following table briefly explains the shortcut commands.

Command Description
Tasks > Detach Database Opens the Detach Database dialog to detach a database in SQL Server.
Tasks > Copy Database Opens the Copy Database dialog to copy a database from one SQL Server database engine to another.
Tasks > Take Offline Temporarily disconnects databases from the SQL Server instance.
Tasks > Bring Online Reconnects disconnected databases in the SQL Server instance.
Tasks > Find Invalid Objects Opens the Find Invalid Objects document to search for invalid objects in multiple databases. Alternatively, press Ctrl+Alt+F.
Tasks > New Schema Comparison Opens the New Schema Comparison dialog to set up and run schema comparison for the selected databases.
Tasks > New Data Comparison Opens the New Data Comparison dialog to set up and run data comparison for the selected databases.

Tables

Edit tables

To edit tables in bulk:

1. In Database Explorer, right-click the tables you want to edit and select Open Editor.

2. Table Editor opens for each selected table.

3. Update the details of the tables. For more information, see Work with Table Editor.

Note

You cannot change the schema to which the tables belong.

3. At the bottom of each Table Editor, select Apply Changes to save and apply the changes made to the tables.

Truncate tables

To truncate tables in bulk:

1. In Database Explorer, from which you want to delete all data and select Truncate Table.

2. In the Drop Table confirmation dialog that opens, select Yes to confirm the deletion.

Note

You cannot undo the truncate table operation, as it permanently deletes all data. It is recommended that you back up the database before deleting it. For instructions, see How to back up a SQL Server database.

View and manage data

To view and manage data in multiple tables:

1. In Database Explorer, right-click the tables whose data you want to view and manage and select Open Data in Editor. Alternatively, select Open Editor and switch to the Data tab.

2. The Data tab of Table Editor opens for each selected table.

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

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

Retrieve data

To retrieve data from the selected tables, in Database Explorer, right-click the tables and select Select All Rows. The SELECT statements with the results grids open for each table.

Manage multiple tables using the shortcut menu

The following table briefly explains the shortcut commands.

Command Description
Generate Script As Generates scripts for each selected table to the CREATE, DROP, DROP and CREATE, SELECT, INSERT, UPDATE, DELETE, INSERT/UPDATE STORED PROCEDURE, or CRUD statements to a new SQL document, to a single file, or to the clipboard.

Note: If you select tables from different servers, you can generate only the CRUD statements.
Export Data Opens the Data Export wizard to export data from the selected tables to a file with the supported file extension.

Note: This option is available only for the tables located on the same server.
Send to > Query Builder Adds the selected tables to the Query Builder diagram.
Send to > Master Detail Browser Adds the selected tables to the Master Detail Browser document.
Send to > Database Diagram Adds the selected tables to a database diagram.
Delete Drops the selected object from the database.
Alternatively, press Del.

Views

Edit views

To edit views:

1. In Database Explorer, right-click the views you want to edit and select Open Editor.

2. View Editor opens for each selected view.

3. Update the details of the views.

Note

You cannot update the schemas to which the views belong.

4. At the bottom of each View Editor, select Apply Changes to save and apply the changes made to the views.

Retrieve data

To retrieve data from the selected views, in Database Explorer, right-click the views and select Select All Rows. The SELECT statements with the results grids open for each view.

Manage multiple views using the shortcut menu

The following table briefly explains the shortcut commands.

Command Description
Export Data Opens the Data Export wizard to export data from the selected view to a file with the supported file extension.

Note: This option is available only for the views located on the same server.
Generate Script As Generates a script for each selected view using the CREATE, CREATE OR ALTER, DROP, DROP and CREATE, ALTER, SELECT, INSERT, UPDATE, DELETE, INSERT/UPDATE STORED PROCEDURE, or EXEC sp_refreshview statements. The script can be saved to a new SQL document or a file, or copied to the clipboard.
Send to > Query Builder Adds the selected views to the Query Builder diagram.

Note: This option is available only for the views located on the same server.
Send to > Master Detail Browser Adds the selected views to the Master Detail Browser document.

Note: This option is available only for the views located on the same server.
Send to > Database Diagram Adds the selected views to a database diagram.

Note: This option is available only for the views located on the same server.
Delete Drops the selected object from the database.
Alternatively, press Del.

Stored procedures

Edit stored procedures

To edit stored procedures:

1. In Database Explorer, right-click the selected stored procedures and select Open Editor.

2. The SQL documents with the CREATE PROCEDURE statements open for each selected stored procedure.

3. Make the changes.

4. On the SQL toolbar, select Save to save the changes for each stored procedure. Alternatively, go to the File menu and select Save or press Ctrl+S.

Manage multiple stored procedures using the shortcut menu

The following table briefly explains the shortcut commands, which appear when you right-click the multiple stored procedures in Database Explorer.

Note

These options are available for stored procedures on the same server.

Command Description
Generate Script As Generates a script for each selected stored procedure using the CREATE, CREATE OR ALTER, DROP, DROP and CREATE, ALTER, and EXECUTE statements. The script can be saved to a new SQL document or a file, or copied to the clipboard.
Send to > Database Diagram Adds the selected stored procedure to a database diagram.
Delete Drops the selected object from the database.
Alternatively, press Del.

Functions

Edit functions

To edit functions:

1. In Database Explorer, right-click the selected functions and select Open Editor.

2. The SQL documents with the CREATE FUNCTION statements open for each selected function.

3. Update the functions.

4. At the bottom of each SQL document, select Apply Changes to save and apply the changes made to the functions.

Shortcut menu commands

The following table describes the shortcut commands, which appear when you right-click the multiple functions in Database Explorer.

Name Description
Generate Script As Generates a script for each selected function using the CREATE, CREATE OR ALTER, DROP, DROP and CREATE, ALTER, SELECT, and EXECUTE statements. The script can be saved to a new SQL document or a file, or copied to the clipboard.
Note: The commands may differ depending on the function type.
Send to > Database Diagram Adds the selected functions to a database diagram.

Note: This option is available only for the views located on the same server.
Delete Drops the selected object from the database.
Alternatively, press Del.

Triggers

Edit triggers

Note

You can manage multiple triggers in bulk only if they are located on the same server.

1. In Database Explorer, right-click the selected DDL triggers and select Open Editor.

2. The SQL documents with the CREATE TRIGGER statements open for each selected trigger.

3. Modify the DDL triggers.

4. On the SQL toolbar, select Save to save the changes. Alternatively, go to the File menu and select Save or press Ctrl+S. Do the same for each trigger you edited.

Turn on DDL triggers

To turn on triggers, in Database Explorer, right-click the selected DDL triggers and select Enable.

Turn off DDL triggers

To turn off triggers, in Database Explorer, right-click the selected DDL triggers and select Disable.

Shortcut menu commands

The following table describes the shortcut commands, which appear when you right-click the multiple triggers in Database Explorer.

Name Description
Generate Script As Generates a script for each selected trigger using the CREATE, CREATE OR ALTER, DROP, DROP and CREATE, and ALTER statements. The script can be saved to a new SQL document or a file, or copied to the clipboard.
Delete Drops the selected objects from the database.
Alternatively, press Del.

Sequences

Edit sequences

To edit sequences:

1. In Database Explorer, right-click the selected sequences and select Open Editor.

2. The SQL document with the CREATE SEQUENCE statements open for each selected sequence.

3. Make the changes.

4. At the bottom of each SQL document, select Apply Changes to save the sequence.

Shortcut menu commands

The following table describes the shortcut commands, which appear when you right-click the multiple sequences in Database Explorer. This table also applies to other database objects, such as assemblies, defaults, and rules.

Name Description
Generate Script As Generates a script for each selected sequence using the CREATE, DROP, and DROP and CREATE statements. The script can be saved to a new SQL document or a file, or copied to the clipboard.
Delete Drops the selected objects from the database.
Alternatively, press Del.