0% found this document useful (0 votes)
150 views1 page

SQL Server - DBCC Clonedatabase Error - MSG 2601

The document discusses errors received when trying to clone a SQL database using DBCC CLONEDATABASE. Specifically, it received error message "Msg 2601: Cannot Insert Duplicate Key Row in Object 'sys.sysowners' With Unique Index 'nc1'." indicating a duplicate key in the sysowners system table. The solution was to check for any user objects created in the model database, as DBCC CLONEDATABASE does not support cloning if objects exist in model. In this case, dropping a user from the model database resolved the issue.

Uploaded by

message2teja
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
150 views1 page

SQL Server - DBCC Clonedatabase Error - MSG 2601

The document discusses errors received when trying to clone a SQL database using DBCC CLONEDATABASE. Specifically, it received error message "Msg 2601: Cannot Insert Duplicate Key Row in Object 'sys.sysowners' With Unique Index 'nc1'." indicating a duplicate key in the sysowners system table. The solution was to check for any user objects created in the model database, as DBCC CLONEDATABASE does not support cloning if objects exist in model. In this case, dropping a user from the model database resolved the issue.

Uploaded by

message2teja
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

SQL SERVER � DBCC CLONEDATABASE Error � Msg 2601: Cannot Insert Duplicate Key Row

in Object �sys.sysowners� With Unique Index �nc1�.


July 5, 2019
Pinal Dave
SQL
No Comments
A few days ago, I wrote a blog about an error while creating a clone of a database
using DBCC CLONEDATABASE command. Here is the link to read that blog. SQL SERVER �
DBCC CLONEDATABASE Error: Cannot Insert Duplicate Key Row In Object
�sys.sysschobjs� With Unique Index �clst�.

Here is another error received by me while running DBCC CLONEDATABASE. The message
looks very similar but different system table.

SQL SERVER - DBCC CLONEDATABASE Error - Msg 2601: Cannot Insert Duplicate Key Row
in Object 'sys.sysowners' With Unique Index 'nc1'. cloneing-800x291

Solarwinds
Database cloning for �SQLAUTH� has started with target as �SQLAUTH_CLONE�.
Msg 2601, Level 14, State 1, Line 1
Cannot insert duplicate key row in object �sys.sysowners� with unique index �nc1�.
The duplicate key value is (Domain\DBReader).

WORKAROUND/SOLUTION for CLONEDATABASE


Since it was appearing again, I started reading more about it and documentation
from Microsoft says below:

DBCC CLONEDATABASE doesn�t support the creation of a clone if there are any user
objects (tables, indexes, schemas, roles, and so on) that were created in the model
database. If user objects are present in the model database, the database clone
fails with the following error message:

Msg 2601, Level 14, State 1, Line 1


Cannot insert duplicate key row in object with unique index �index name�. The
duplicate key value is

That makes perfect sense. As per documentation, I need to drop the object from the
model database. As per error message which I received, it was due to a user in the
model database. Once I dropped user, it went fine.

You might also like