BuildPrimaryKeySql will use "IS NULL" instead of = null when it
encounters a null value. Really only relates to composite primary keys.
This is also bad DB design but I'm being forced to support it. Also
added unit tests for Exists