dbt-msft / tsql-utils

dbt-utils for the dbt-msft family of packages
MIT License
26 stars 27 forks source link

add dbt_utils/sqlserver__generate_surrogate_key macro to fix concat bug #98

Closed lucaslortiz closed 2 months ago

lucaslortiz commented 1 year 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

nickteff commented 3 months ago

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.

nickteff commented 2 months ago

Thank you @sdebruyn!