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?
instead of left . try with SUBSTRING
e.g : select SUBSTRING(TEXT,1,200) from dbo.tblText
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) .....
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With