My articles about the MSSQL Database

Fix the INSERT statement FOREIGN KEY constraint conflict error

It is very common to do migrations of data from a table of one database to another or inserting backed-up data into a table. For these tasks you will have to use long .sql scripts with INSERT statements.

When doing such migrations one possible problem might be that the Foreign Keys referenced in the primary-table will throw the INSERT statement conflicted with the FOREIGN KEY constraint “XXX. The conflict occurred in database “”, table “”, column “” error.

Read the complete article

How to rename a column in an MSSQL temporal table

Temporal tables is a neat feature that allows us to version the data of our MSSQL-tables so that we keep a history of changes made. The renaming of columns of a table which is backed up by a temporal table is not 100% straightforward since you do not get the “Design” option when you right click on the table in SQL Management Studio. To perform the renaming, do the following steps:

Read the complete article