Error while executing the SP

  • Hi,

    I am getting the following error while executing the SP.

    "Pivot grouping columns must be comparable. The type of column "Results" is "ntext", which is not comparable."

    Is there any way to avoid this error? The datatype of column "Results" is "ntext" itself, as mentioned in the error message.

  • Use another data type instead of ntext?

    Ntext is deprecated by the way.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Ok,

    What is the difference between varchar, nvarchar, and ntext?

    Which datatype is the best suited to represent a string data?

  • char, varchar and text are all character strings.

    char has a fixed length, while varchar has a varying length.

    text is also varying length, but is used for blob storage. It is deprecated, so you better use varchar(max).

    The same data types prefixed with n are the unicode equivalents.

    Data Types (Transact-SQL)

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • I avoided the error, achieved this way:

    SELECT convert(nvarchar(max),LF.description) AS Results

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply