tsql-utils icon indicating copy to clipboard operation
tsql-utils copied to clipboard

add dbt_utils/sqlserver__generate_surrogate_key macro to fix concat bug

Open lucaslortiz opened this issue 1 year ago • 0 comments

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

lucaslortiz avatar Aug 21 '23 09:08 lucaslortiz

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 avatar Aug 07 '24 21:08 nickteff

Thank you @sdebruyn!

nickteff avatar Sep 10 '24 15:09 nickteff