Posts tagged sql database

Get the number of rows affected by the last T-SQL

To get the number of rows affected by the last T-SQL statement in SQL server, you could youse the @@ROWCOUNT system function.

Read more ...


Custom Sequential Number Django Model Field

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.

Read more ...


Enable Database Lock Timeout in Django

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.

Read more ...