Create a copy of a database object

You can create a copy of a database object and modify its settings as needed.

To copy a database object:

1. In Database Explorer, right-click the required object, then select Duplicate Object.

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

Note

By default, the copied object inherits the configuration settings from the source database object.

3. In Destination connection, select the server connection. You can also create a new connection or update an existing one.

Tip

To create or update a server connection:

1. In Destination connection, select Manage.

2. In the Connection Manager dialog, click New to create a connection or Edit to modify an existing one.

3. In the Database Connection Properties dialog, configure connection settings.

4. In the Connection Manager dialog, click OK to select this connection for a new database object.

4. In Destination database, select the target database for the object.

Tip

To update the list of target databases, in Destination database, click Refresh.

5. In Destination schema, select the schema where the new object will be created.

6. In New object name, enter the name of a new object. By default, the object name consists of the source object name followed by _copy.

7. Optional: To copy an object with data, select Copy data.

Note

The Copy data checkbox is only available for a database table.

8. Optional: To delete the target object after creating its copy, select Drop destination object.

9. Optional: To open the generated script in a new SQL document, expand the Script Changes menu and select To New SQL Window. To copy the script to the clipboard, select To Clipboard.

View script changes

10. Click OK.

Note

When you expand the object type node in Database Explorer, the number of objects it contains appears in parentheses next to the node name. This number is updated automatically after you add, delete, or filter objects.