If you have a process which can delete records from the database, it would be best to DeleteFlag them instead. You should add a few columns denoting when it was “deleted” and who by; DeleteFlag boolean column, DeleteUserID column and DeleteDateTime stamp. Unless where GDPR laws applies, there are a few good reasons why you… Continue reading Don’t Delete Records. DeleteFlag instead
If you need to insert multiple records at the same time. Writing out those SQL insert queries can be laborious. Setting the same fields and then amending the values. You can batch insert several records with one INSERT command and add new values on each line as many you like.
We’re going to cover on how to write a stored procedure with a series of stored procedures. That means running a number of stored procedures within one stored procedure. You might do this for effiency and to avoid duplicating your SELECT/INSERT queries. We will create Stored Procedures to return primary keys to be subsequently used… Continue reading Create a Stored Procedure with a series of stored procedures