Created On:  28 November 2011

Problem:

After carrying out a StarTeam database restore why do I get the following error:    Cannot insert duplicate key in object 'S12' The statement has been terminated

Resolution:

This issue is occurs when the ODBC connection that the StarTeam server is using to access the StarTeam Database is still pointing to the old Database instance. The StarTeam server will throw errors related to inserting duplicate keys during the server start up process, for example,

Violation of PRIMARY KEY constraint 'PS12'. Cannot insert duplicate key in object 'S12'.
The statement has been terminated.

To resolve this issue:

1. Navigate to the ODBC Data Source Administration Dialogue under Administrative tools
2. Highlight the StarTeam Data Source and click "Configure"
3. Update the SQL Server details by selecting the SQL instance which the StarTeam database has been restored to
4. Click next and then proceed to log in
5. Select the "Change the default database to:" check box and select the StarTeam database from the pull down menu
6. Click next and then click finish

Ensure that the StarTeam Server configuration options specify the ODBC connection that has been amended:

1. Open the StarTeam Server Administration Console
2. Highlight the server configuration from the server tree
3. Click on the Configuration properties from the top toolbar
4. Select the "Database Connection Information" tab and ensure the ODBC database name matches the name of the amended ODBC connection
5. Test connection
6. Start the StarTeam server

Incident #2546821