<turbo-stream action="update" target="wiki_card"><template>
<h1>Violation of PRIMARY KEY constraint</h1>
<p><strong>Scenario</strong>: Occurs when trying to insert a record with a duplicate value in a column that has a PRIMARY KEY constraint.<br><br><strong>Error Message</strong>: <code>Native Error Code: 2627 SQL State: 23000 [Microsoft][ODBC SQL Server Driver][SQL Server]Violation of PRIMARY KEY constraint. Cannot insert duplicate key in object 'dbo.XYZ'. The duplicate key value is (XZZ).</code><br><br><strong>Cause</strong>: The record already exists in the database, or the key field is not unique in the source data.<br><br></p><div><strong>Resolution</strong>:<br><br></div><ul><li>Check if the record already exists by using a query (<code>SELECT * FROM [Table] WHERE [PrimaryKeyColumn] = 'Value'</code>).</li><li>Ensure the source data generates unique keys (e.g., combining fields or using GUIDs).</li></ul>
</template></turbo-stream>

<turbo-stream action="replace" target="meta_description"><template><meta content='Violation of PRIMARY KEY constraint' id='meta_description' name='description'></template></turbo-stream>
<turbo-stream action="replace" target="meta_keywords"><template><meta content='Violation of PRIMARY KEY constraint NAV SQL error message' id='meta_keywords' name='keywords'></template></turbo-stream>
<turbo-stream action="update" target="meta_title"><template>Violation of PRIMARY KEY constraint - MyRapidi Wiki</template></turbo-stream>
<turbo-stream action="prepend" target="flash"><template></template></turbo-stream>
