Closed. This question needs debugging details . It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem . This will help others answer the question.
Closed 3 days ago.
Improve this question
I get this error:
Msg 547, Level 16, State 0, Line 105
The INSERT statement conflicted with the CHECK constraint "CK__Orders__Order_St__33D4B598". The conflict occurred in database "Online_Sales", table "dbo.Orders", column 'Order_Status'.
I tried inserting data into a table in SQL Server, when I got this error.
1条答案
按热度按时间2ul0zpep1#
There is a check constraint defined on the table that, essentially, says "you can't insert data unless you pass these rules." You need to determine what those rules (the check constraint's definition) are, and make sure your data can pass that test.
There are ways to drill down in SSMS to find these rules. Another alternative is to query the system tables, which is what I generally do--but only because I have access to a bunch of support scripts, accumulated over the years. Below is one that should help you find the code in question.