SQL: ANSI string concatenation with the || and ||= operators
One change that was applied to Azure SQL Database a while back, and is coming in SQL Server 2025, is the use of ANSI string concatenation operators.
SQL Server has been using the + sign as a string concatenation operator since the early days, but that’s the same operator that’s used for numbers, and it’s not the ANSI standard. You’ll find that other database engines like PostgreSQL do not use + to join strings together; they use the || operator. I’ve been writing quite a lot of PostgreSQL lately, and avoiding using + to concatenate strings is always a challenge for my coding muscle memory.
2025-11-26

