Script to generate Trigger definitions

Last week we implemented a database for which the developer didn’t have the CREATE TRIGGER scripts.  Unfortunately this is quite a frequent occurance and happens when database code (and objects) are implemented directly into a database and an assumption is made that the code is safely stored in the database/... [Read More]

Apply the principle of least privilege on a Linked Server connection

Linked Servers are easy to set up in all versions of SQL Server.  Using a Linked Server one can connect to databases on the same SQL Server instance, on other instances, other DBMSs such as Oracle, MySQL, Informix and using the appropriate driver (e.g. OLEDB, ODBC, etc.), even Microsoft Access or... [Read More]

Correctly handling datetime values

I was recently asked why, when an application was saving datetime values sometimes the actual value stored is different than the one sent to the database.  After investigating the issue I discovered that the programmers were relying on the local/client machine’s Regional Settings to display dates to the end user... [Read More]