We prefer to name all primary key constraints explicitly and not let SQL server come up with its own names. In this case: We always know what name to look for. Standard name, which in our case looks like PK_tableName, simplifies automatic maintenance of primary keys: if all names are standard, they can be used […]
Read MoreUsing a DDL trigger to control and automate history of data changes
Summary: DDL trigger does all the magic of automatic support of historical data, all you need is to run the script against your database (once). After that you can turn history on tables on, off, or pause it. It will keep audit of all schema changes in your database and automatically generate DML triggers on […]
Read MoreINCLUDE Clause in Non-clustered Indexes
Summary: improve performance of you queries by including hot data into index If you have a big table, let’s say with 100 columns and million rows, and some of those 100 columns, say 5 of them are being used in queries very often, you may significantly improve performance by building a special non-clustered index with […]
Read More
Recent Comments