Skip to content

generate_surrogate_key fails on SQL Server with one field #827

@jlkravitz

Description

@jlkravitz

The culprit line is here: https://github.com/dbt-labs/dbt-utils/blob/6ba7b660b1d1b4e3b41cb0cf6c3c0e4a70ae54e4/macros/sql/generate_surrogate_key.sql#L27C35-L27C35

select a, b, c, d, {{ dbt_utils.generate_surrogate_key(["a"]) }}
from my_table

results in error

('42000', '[42000] [Microsoft][ODBC Driver 18 for SQL Server][SQL Server]The concat function requires 2 to 254 arguments. (189) (SQLMoreResults)')```

I would expect this not to error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions