I have a field with datatype VARCHAR and MAX length. However, I just want to print only the first 2000 characters from that field. I cannot use VARCHAR(2000) as the datatype for the field upon table creation since there are a records exceeding this length and as you might all know, this results in a 'String or binary data would be truncated' error.
What I'm doing is sending an email report which may get too lengthy because of that field so I just want to output the first 2000 characters.
Any help would be greatly appreciated! Thanks in advance!
you can use substring.
select SUBSTRING(yourcolumnname,0,2000) from yourtablename
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