Skip to Content

A workaround for the identifier too long error?

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
Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Feb 08, 2018 at 04:47 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • 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

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.