J3FFK
J3FFK

Reputation: 684

SQL Server : FOR XML PATH: the identifier that starts with ... is too long. maximum length is 128

While trying to create an XML result using FOR XML PATH in T-SQL (SQL Server 2008) I stumbled across this error:

The identifier that starts with ... is too long. maximum length is 128

The line it errors on is pretty deep and more than 128 characters long:

GlobalTradeItemInformation/tradingPartnerNeutralTradeItemInformation/cataloguePrice/tradeItemPrice/priceBracket/@rangeUnitOfMeasure'

Besides using a subselect with another FOR XML statement in it, what are the options to resolve this? For example, is this a setting in SQL Server which can be changed? Any other workarounds?

Upvotes: 0

Views: 686

Answers (1)

Ben Thul
Ben Thul

Reputation: 32717

There is no setting that you can change for this. The issue that you're running into is detailed here. Search that page for "identifier" and you'll see that the 128 length is hard-coded.

Upvotes: 1

Related Questions