Click here to Skip to main content
15,748,748 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
In SQL Server table,Iam Getting error like ...Cannot insert duplicate key row in object 'dbo.test' with unique index 'IX_testid'. The duplicate key value is (<null>).

Please help me on this what to do

What I have tried:

I am not getting what to do with this error .
Updated 3-Mar-23 13:01pm

1 solution

You are passing NULL values all the time during Insert execution.

Unique key will not be going to allow duplicate values to a table

Make sure your input should be unique always before execution of a statement.

For better information please share your code.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900