Unique Key Exception in the softwarelist or softwaremanufacturer table encountered during DB Migration from PostgreSQL to MSSQL.
[07:25:00:717]|[10-22-2024]|[com.adventnet.db.adapter.mssql.MssqlDBAdapter]|[SEVERE]|[62]: Problem while executing ALTER SQL in DB.
The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name 'dbo.SoftwareManufacturer' and the index name 'SoftwareManufacturer_UK1'. The duplicate key value is (Canon Inc.).|
java.sql.SQLException: The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name 'dbo.SoftwareManufacturer' and the index name 'SoftwareManufacturer_UK1'. The duplicate key value is (Canon Inc.).
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:262)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1632)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(SQLServerStatement.java:872)
[07:25:09:828]|[10-22-2024]|[com.adventnet.db.adapter.mssql.MssqlDBAdapter]|[SEVERE]|[64]: Problem while executing ALTER SQL in DB.
The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name 'dbo.SoftwareList' and the index name 'SoftwareList_UK'. The duplicate key value is (Intel® Arc�� Control, 1).|
java.sql.SQLException: The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name 'dbo.SoftwareList' and the index name 'SoftwareList_UK'. The duplicate key value is (Intel® Arc�� Control, 1).
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:262)
![Idea](https://static.zohocdn.com/zoho-desk-editor/static/images/lights.png/)
Steps to resolve the issue (for versions 14920 and later):
- Windows : Remove the "rem" from the following line in the migrateDB.bat file and initiate the DBMigration with new destination Database name:
- rem set JAVA_OPTS=-DhandleColTables="SoftwareList,SoftwareManufacturer"
- Linux : Remove the "#" from the following line in the migrateDB.sh file and initiate the DBMigration with new destination Database name:
- #JAVA_OPTS="-DhandleColTables=SoftwareList,SoftwareManufacturer"
![Idea](https://static.zohocdn.com/zoho-desk-editor/static/images/lights.png/)
Steps to resolve the issue (for versions earlier than 14920):