cancel
Showing results for 
Search instead for 
Did you mean: 

A workaround for the identifier too long error?

former_member548403
Participant
0 Kudos

This code below gives me the identifier too long error and I have been researching a workaround for it. So far nothing good has turned up... Would anyone know how to handle this error?

select name, 
   [If yes, please specify one of the following languages (American Sign 
Language (ASL), Amharic, Chinese, French, Korean, Spanish or Vietnamese):]
from 
(
select name, question, response
from [dw_prod].[dbo].[Assessment$]
) as sourceTable
pivot
(
max (response)
for question
in (
[If yes, please specify one of the following languages (American Sign 
Language (ASL), Amharic, Chinese, French, Korean, Spanish or Vietnamese):]
)
)
as pivottable

Accepted Solutions (1)

Accepted Solutions (1)

clas_hortien
Employee
Employee

Hello,

you have specified the string

Ifyes, please specify one of the following languages (American SignLanguage(ASL), Amharic, Chinese, French, Korean, Spanish or Vietnamese):

as the column name for the second column. This string is too long (143 chars), the maximum length is 128 chars.

Best regards

Clas Hortien

former_member548403
Participant
0 Kudos

Yes, I know. Do you know how to truncate it with the PIVOT function?

clas_hortien
Employee
Employee
0 Kudos

This is not possible, you have to shorten it in the select list already. Soemthing like:

select name, 
   [Choose one: American Sign Language (ASL), Amharic, Chinese, French, Korean, Spanish or Vietnamese]
from 
(
select name, question, response
from [dw_prod].[dbo].[Assessment$]
) as sourceTable
pivot
(
max (response)
for question
in (
[Choose one: American Sign Language (ASL), Amharic, Chinese, French, Korean, Spanish or Vietnamese]
)
)
as pivottable

Answers (0)