DBCC CLONEDATABASE
creates a schema-only clone
What changes
- Input
- source database schema and statistics
- Output or change
- new read-only schema-only database
Syntax at a glance
DBCC CLONEDATABASE ( source_database_name , target_database_name ) [ WITH { [ NO_STATISTICS ] [ , NO_QUERYSTORE ] [ , VERIFY_CLONEDB | SERVICEBROKER ] [ , BACKUP_CLONEDB ] } ]
Work example
A plan regression needs a schema and statistics clone without copying application rows.
Create the clone only in an approved nonproduction instance and record its source and purpose.
Check your work The clone contains definitions and statistics but no user table data.
Open Microsoft Learn for full syntax, permissions, and details for your version.