dbt-sqlserver icon indicating copy to clipboard operation
dbt-sqlserver copied to clipboard

dbt.type_string() compiles to varchar(8000)

Open pSpitzner opened this issue 7 months ago • 0 comments

I noticed that dbt.type_string() compiles to varchar(8000) and wondered if this is intended behaviour.

On other backends, like duckdb, or postgres in particular, it comiles to TEXT, which I think in sql server would be closer to varchar(max) than varchar(8000). Also, in the dbt docs it says _"This macro yields the database-specific data type for TEXT.", implying the unlimited length?

In my current use-case, this leads to a bit of inconsistent behaviour, and I am now wondering if I want to introduce a custom macro to ensure a string type of unlimited length. However, if other users would also expect strings of unlimited length, we might just make the change here?

Thanks! Paul

ps: thanks for maintaining this awesome project!

pSpitzner avatar Sep 30 '25 09:09 pSpitzner