argument data type ntext is invalid for argument 1 of rtrim function
-
i use this line in my script Select Data = ltrim(rtrim(@RowData)) @RowData is ntext so i receive this error when trying to execute it argument data type ntext is invalid for argument 1 of rtrim function so what is the replacement to work with ntext instead of ltrim & rtrim
md_refay
-
i use this line in my script Select Data = ltrim(rtrim(@RowData)) @RowData is ntext so i receive this error when trying to execute it argument data type ntext is invalid for argument 1 of rtrim function so what is the replacement to work with ntext instead of ltrim & rtrim
md_refay
What database is it? If it is SQL Server 2008, you should use
nvarchar(max)
instead ofntext
. Most string functions cannot work withntext
. EDIT: As a workaround, you can do this:Select Data = CAST(ltrim(rtrim(CAST(@RowData AS nvarchar(max))) AS ntext)
modified on Monday, August 8, 2011 11:45 AM