Utilizo el tipo de datos text
en una de mis tablas y también uso PIVOT
con la consulta también. No puedo usar MAX(AttributeValue)
donde AttributeValue
es el tipo de text
. Devuelve el siguiente error Operand data type text is invalid for max operator.
. ¿Cómo puedo usarlo aquí? Porque me impuso usar una función aggregate
con PIVOT
.MAX (text) returns El texto del tipo de datos de operando no es válido para el operador max. en el servidor sql 2008
Editar: que siguieron el puesto http://msdn.microsoft.com/en-us/library/ms187993.aspx
traté de convertir el tipo de datos a nvarchar(max)
.
ALTER TABLE dbo.MyTable
ALTER COLUMN AttributeValue NVARCHAR(MAX)
También tengo que usar Full Text Search
opción también. Me sale el siguiente error Cannot alter or drop column 'AttributeValue' because it is enabled for Full-Text Search.
SELECT
[6B93119B-263B-4FED-AA89-198D26A3A3C4] DOB
,[F1A0D9D6-702E-4492-9EBC-63AD22E60E6A] CaseTitle
FROM MyTable PIVOT
( MAX(AttributeValue)
FOR AttributeID IN
(
[6B93119B-263B-4FED-AA89-198D26A3A3C4]
,[F1A0D9D6-702E-4492-9EBC-63AD22E60E6A]
)
) ResultTable
Cuando el 'AttributeValue' es de 'texto' tipo de datos. Aparece el siguiente error,
El texto del tipo de datos del operando no es válido para el operador max.
Bueno, traté de convertir el campo a nvarchar (max). Da otro tipo de error (en la cuarta línea).
Incorrect syntax near '('
¿Echo de menos algo?
Ver mi edición :(. Me aparece un error. – Rauf