dbt-msft / tsql-utils

dbt-utils for the dbt-msft family of packages
MIT License
25 stars 24 forks source link

add dbt_utils/sqlserver__generate_surrogate_key macro to fix concat bug #98

Open lucaslortiz opened 10 months ago

lucaslortiz commented 10 months ago

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