Clone a database
dbcc clonedatabase
creates a new
database and then clones the
structure of an existing database into the new one.
dbcc clonedatabase( origdb, newdb )
The original and new database need to be on the same
instance. In order to clone a database to another instance,
SqlPackage.exe
.
Dump content of a page
Do not send output to errorlog:
dbcc traceon (3604);
Dump content of page in database tq84_db
whose file id is 1 and hose page id is 312.
dbcc page (
/* database name: */ 'tq84_db',
/* file id : */ 1,
/* page id : */ 312,
/* option : */ 3
) with tableresults;
The value of option is one of
0 | Page header only. |
1 | Page header + hex dump per row + page slot array (if available). |
2 | Page header + hex dump for entire page. |
3 | page header + detailed explanation for each record in the page. |
Misc
Check current identity value:
dbcc checkident ('TABLE_NAME', reseed, 0);
Collect performance statistics(?):
dbcc sqlperf