Repository: dbt-labs/dbt-core
Pull request: Tsql not equal workaround
resolves #3001 
@jtcohen6 @mikaelene 

<!---
  Include the number of the issue addressed by this PR above if applicable.
  PRs for code changes without an associated issue *will not be merged*.
  See CONTRIBUTING.md for more information.

  Example:
    resolves #3001 
-->


### Description


per this conversation
https://github.com/dbt-msft/dbt-synapse/pull/32#discussion_r553758414


### Checklist
 - [x] I have signed the [CLA](https://docs.getdbt.com/docs/contributor-license-agreements)
 - [x] I have run this code in development and it appears to resolve the stated issue
 - [x] This PR includes tests, or tests are not required/relevant for this PR
 - [x] I have updated the `CHANGELOG.md` and added information about my change to the "dbt next" section.


Problem statement:
condA != condB not supported in TSQL
`snapshot_check_strategy()` is not dispatched, which means it can only be overridden in a custom adapter. Which was working for `dbt-sqlserver` but we can't import that overwritten macro into `dbt-synapse` like we're doing with all the other properly dispatched macros.

rather than dispatching the entire `snapshot_check_strategy()`, we can, with a simple tweak to logic, modify it so that it works on TSQL but doesn't break the existing adapters.

The benefit is a lower code footprint which means the dbt-msft adapters can stay more current with `dbt-core`

Hints from issue discussion:

Commit message: for posterity

Patch to review:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 706448c1132..1724cef8f94 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,7 +1,11 @@
 ## dbt 0.19.0 (Release TBD)
 
+### Under the hood
+- rewrite logic in `snapshot_check_strategy()` to make compatible with TQL [#3000](https://github.com/fishtown-analytics/dbt/pull/3000)
+
 Contributors:
 - [@dbeatty10](https://github.com/dbeatty10) ([dbt-adapter-tests#10](https://github.com/fishtown-analytics/dbt-adapter-tests/pull/10))
+- [@swanderz](https://github.com/swanderz) [#3000](https://github.com/fishtown-analytics/dbt/pull/3000)
 
 ## dbt 0.19.0rc1 (December 29, 2020)
 
diff --git a/core/dbt/include/global_project/macros/materializations/snapshot/strategies.sql b/core/dbt/include/global_project/macros/materializations/snapshot/strategies.sql
index e3f1966c6af..f366fc7c658 100644
--- a/core/dbt/include/global_project/macros/materializations/snapshot/strategies.sql
+++ b/core/dbt/include/global_project/macros/materializations/snapshot/strategies.sql
@@ -164,7 +164,14 @@
     {%- for col in check_cols -%}
         {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}
         or
-        ({{ snapshotted_rel }}.{{ col }} is null) != ({{ current_rel }}.{{ col }} is null)
+        {# hack to make CI try again #}
+        {# below is equivalent to the two clauses being not equal (!=) to one another  #}
+        {# ({{ snapshotted_rel }}.{{ col }} is null) != ({{ current_rel }}.{{ col }} is null) #}
+        (
+            (({{ snapshotted_rel }}.{{ col }} is null) and not ({{ current_rel }}.{{ col }} is null))
+            or
+            ((not {{ snapshotted_rel }}.{{ col }} is null) and ({{ current_rel }}.{{ col }} is null))
+        )
         {%- if not loop.last %} or {% endif -%}
     {%- endfor -%}
     {%- endif -%}


Code review comments:
diff_hunk: @@ -164,7 +164,14 @@
     {%- for col in check_cols -%}
         {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}
         or
-        ({{ snapshotted_rel }}.{{ col }} is null) != ({{ current_rel }}.{{ col }} is null)
+        {# hack to make CI try again #}
+        {# below is equivalent to the two clauses being not equal (!=) to one another  #}
+        {# ({{ snapshotted_rel }}.{{ col }} is null) != ({{ current_rel }}.{{ col }} is null) #}
path: core/dbt/include/global_project/macros/materializations/snapshot/strategies.sql
text: @user1:
Remove comments
```suggestion
```