Your cart is currently empty!
Category: Database
-
[Solved] Entity framework – Violation of PRIMARY KEY constraint ‘…’. Cannot insert duplicate key in object ‘dbo…’ the duplicate key value is (…). The statement has been terminated.
If you are struggling to create a new record in a sql db when using entity framework and you are ending up with an error that looks like this: What this means is that in SQL databases often a table will have a primary key id. And this primary key is generated by the data…
-
SQL Cheat Sheet
List all rows in a table: SELECT * FROM table_name; List specific columns in a table: SELECT column1, column2 FROM table_name; Filter rows using a WHERE clause: SELECT * FROM table_name WHERE condition; Update rows in a table: UPDATE table_name SET column1 = value1, column2 = value2 WHERE condition; Insert rows into a table: INSERT…