Recent posts


Calculating Height, Weight and BMI from Incomplete Data

BMI is often used as a measure of obesity when performing population analysis. It is easy to calculate and only requires a persons Height and Weight. The basic formula is Weight in Kilograms divided by Squared Height in Meters. Sometimes when working with large datasets, you may find that you only have part of the picture. Some systems will just log the BMI and either the Height or Weight and not all three measurements. That missing measure can, however, be calculated if the other two are present.

Snippet: Cleaning Read Codes

Simple Regex for cleaning up Read Codes (Read v2 or CTV3). Does no validation, removes trailing dots and local modifications.

Querying SQL's Distribution Database

When trying to query what tables are being replicated most people know about the is_replicated flag in sys.tables, however, fewer know that there is a lot more information available about replication in the distribution database.

Combining MERGE with EXISTS and EXCEPT

By combining EXISTS with EXCEPT you can quickly and efficiently compare whether two columns are equal (including when they are both NULL). Using this method if the column on both sides is NULL then they will be treated as equal; and if one side is NULL and the other not, they will be correctly treated as not equal.

Mapping a Printer Via Command Line

@ECHO Mapping Printers @rundll32 printui.dll,PrintUIEntry /ga /n\\[Insert Server Name]\[Insert Printer Name] @rundll32 printui.dll,PrintUIEntry /in /y /n\\[Insert Server Name]\[Insert Printer Name]


Page 3 of 3