I have a text column that I want to see if it has larger than 4000 characters. If it does have more than 4000 characters, then start at the right most character and go back 4000 characters.
I realize that the following code is not correct. But it is a start.
select
case
when datalength(column1) > 4000 then
right(column1, 4000)
case datalength(column1) <= 4000 then
column1
end
from table_1