How to add a timestamp to SQL database documentation

Documenting SQL database is the best practice to ensure that the organizational schema, data objects, and other related information are captured for some future references, especially during development. In case of frequent documentation due to constant database structure changes, it is crucial to have documents organized in an accurate and chronological manner.

ApexSQL Doc, as a SQL documentation tool, provides various customization options, adjusting the documenting templates and using them as an official documenting form. When it comes to chronologically organized documentation, there’s a simple but useful feature to help keep the documentation properly organized – the timestamp. This small detail will help keep track of the documentation creation date and time, and can also be embedded in the document title template, header and footer, or even as a part of the file name.

The timestamp feature is located under Naming in the lower left Output options pane of the ApexSQL Doc’s main window. From there it is possible to add the {date} tag to several document locations:

Documentation title

As illustrated in the example above, the {date} tag can be added to the documentation Title and/or the Filename. If saved as the default setting every time the documentation is created, creation date will be added automatically. Here’s an example of how generated file names look like with the embedded date tag:

Generated file names

It is also possible to embed timestamps in the document, as a part of the header and/or footer, and have them on every single page of the document. This can be set up under the Custom text option located in the Output options pane:

Inserting the date and time of the documentation is done by using the {date} and {time} tags, inserted either in the Header or the Footer of the document, or even both, and the result is a document containing the timestamp. For example:

Adding the timestamp to a document is a simple yet important detail, especially if there’s a need to keep all the documentation timely and well organized. Using ApexSQL Doc, adding the date/time detail can be automated, making it a standard practice when documenting databases

March 12, 2015