Violation of PRIMARY KEY constraint 'PKSY60100'. Cannot insert duplicate key in object 'dbo.SY60100'
KB Article 871699
The partner then ran the sp_changedbowner system stored procedure to reset the database owner to DYNSA and got the following error:
Msg 15110, Level 16, State 1, Line 1
The proposed new database owner is already a user or aliased in the database
Having gotten this error, we proceeded to drop the DYNSA from the DYNAMICS database as follows:
USE DYNAMICS;
GO
DROP USER DYNSA;
GO
Having dropped the user from the database, we needed to re-add DYNSA as the database owner of the DYNAMICS database. This time, I decided to try the new ALTER AUTHORIZATION statement as the customer is running Microsoft SQL Server 2008 R2, as sp_changedbowner will be deprecated from SQL Server sometimes soon.
ALTER AUTHORIZATION ON DATABASE::DYNAMICS TO DYNSA;
Once we executed this command, we restarted the company creation process in Utilities and the error was no longer.
If you find yourself in a similar situation then this should definitely help.
Until next post!
MG.-
Mariano Gomez, MVP
IntellPartners, LLC
http://www.IntellPartners.com/
Comments
I just ran into this when creating a new company on GP 2010 SP3 (11.00.2044).
The error occurred at the last step in the new company setup, "Create Company Information". I clicked on OK and the setup appeared to complete.
I confirmed that the databases did have 'sa' as the owner, and luckily in my environment, was able to use the change db owner to set them to DYNSA.
sp_changedbowner 'DYNSA'
I'm puzzled how this particular environment ended up with 'sa' as the db owner.
Steve Endow