Style Guide - SQL Server Auditing Column Names
Naming convention for auditing fields in a SQL server table.
commit 917f5dd · authored · amended · 1 min read
For most of the tables in our DB will have some kind of auditing fields. Following are the column names I used to use for those auditing fields.
Creation Audited
| Column Name | Type | Nullable | Description |
|---|---|---|---|
| CreationTime | datetime2(7) | NOT NULL | eg. 2019-09-15 13:56:13.8955178 |
| CreatorUserId | NULL |
Modification Audited
| Column Name | Type | Nullable |
|---|---|---|
| LastModificationTime | datetime2(7) | NULL |
| LastModifierUserId | NULL |
Soft Delete
| Column Name | Type | Nullable |
|---|---|---|
| IsDeleted | bit | NOT NULL |
| DeleterUserId | NULL | |
| DeletionTime | datetime2(7) | NULL |
If you have worked with ABP before, you know from where I adopted the naming convention.
When I work on a non-ABP project, I used to follow the same column names.
Let me know what you used to name for auditing columns in the comments. 👇