In a table, I have a text-field. I need to be able to select only the first 200 chars of the field - but LEFT does not work with TEXT-fields.
What to do?
In a table, I have a text-field. I need to be able to select only the first 200 chars of the field - but LEFT does not work with TEXT-fields.
What to do?
You cannot apply string manipulation functions on TEXT fields - you should stop using TEXT anyway, since it will be removed from SQL Server soon!
What you can do is convert your TEXT column to VARCHAR(MAX) And then use the string gfunction:
SELECT LEFT(CAST(YourTextCol AS VARCHAR(MAX), 200) .....
Marc
instead of left . try with SUBSTRING
e.g : select SUBSTRING(TEXT,1,200) from dbo.tblText