Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>By design, your table <code>[cresql].[dbo].[AR_Transactions]</code> is supposed to hold only one value for the primary key - in your case, this seems to be a combination of columns that make up this PK.</p> <p>This is not a SQL issue, but seems to be a design concept.</p> <p>You should find out what combination of keys is making up your primary key - it may be that the design states that you can insert once and update later on for that combination (although I would not consider this to be good design).</p> <p><strong>EDIT</strong></p> <p>Since Trans_Id is the PK, and you are not using that column in your insert, it is either being inserted as IDENTITY, as a DEFAULT (brrrrr), or using a TRIGGER.</p> <p><strong>IDENTITY:</strong> Check to see if the IDENTITY specification is screwed up. If so, just reset it. Here is how to <a href="https://stackoverflow.com/questions/147210/how-can-i-reseed-an-identity-column-in-a-t-sql-table-variable">How can I reseed an identity column in a T-SQL table variable?</a></p> <p><strong>DEFAULT:</strong> Go find whoever designed the table and ask them</p> <p><strong>TRIGGER:</strong> Find the trigger and read through the code to see what it is doing. Here is how to find a list of triggers <a href="https://stackoverflow.com/questions/636452/what-is-the-best-way-to-check-whether-a-trigger-exists-in-sql-server">What is the most portable way to check whether a trigger exists in SQL Server?</a></p> <p><strong>Alternate scenario:</strong></p> <p>There could be a trigger that inserts into an AUDIT table that may have the problem. Check if the table has any other triggers and see what they do.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload