Posts tagged sql database
Get the number of rows affected by the last T-SQL
- 09 October 2023
To get the number of rows affected by the last T-SQL statement in SQL server, you could youse the @@ROWCOUNT system function.
Custom Sequential Number Django Model Field
- 01 October 2023
Sometimes we need certain functionality again, and again, and again,… Sometimes it just makes sense to encapsulate certain logic into a separate module so it is easier to test and maintan. For example, we might need Django model field that is capable of keeping seqential number of the items in the order they are stored in the database.
Enable Database Lock Timeout in Django
- 14 September 2023
By default clients requesting database lock should wait until the lock is released. This might take forever. In locking contention situations it might be useful to instrument your database to timeout when lock is not being released for given amount of time, e.g. 5 seconds.