tsql-utils
tsql-utils copied to clipboard
add dbt_utils/sqlserver__generate_surrogate_key macro to fix concat bug
This fixes the issue with the default generate_surrogate_key macro. The default macro creates a concat statement, even if it has only one column, while sql server requires at least two columns. I created a macro to generate the surrogate key for SQL server (sqlserver__generate_surrogate_key), adding an if statement before using the concat.
Issue #97
This package is great! Is there any chance this PR can be merged? I've been using it as a hotfix and it works great.
Thank you @sdebruyn!