This project has moved. For the latest updates, please go here.

Error in vts_spVoterGetFullPivot


In the case that vts_tbAnswer.AnswerText is longer than 63 characters, the vts_spVoterGetFullPivot stored procedure will execute with errors.

The error:
The identifier that starts with (@AnswerText + '_' + @QuestionText) Is too long. Maximum length is 128

The Problem:
In the AnswerColumnCursor, the @QuestionText is spliced down to 64 characters, but @AnswerText is not. The '_' also adds an extra character.

The Fix:
Change this line: (line 65)
SELECT AnswerText, AnswerID, left(vts_tbQuestion.QuestionText, 64) FROM vts_tbAnswer
To this:
SELECT left(vts_tbAnswer.AnswerText, 63), AnswerID, left(vts_tbQuestion.QuestionText, 64) FROM vts_tbAnswer
Changing this one line ensures that the column/identifier in the #VoterEntries temporary table inside the stored procedures is always 128 characters or less

I went ahead and fixed this in my own database, but I thought you guys might want to know about it if you don't already.

EDIT: This issue also exists in vts_spVoterGetPivotTextEntries

file attachments