I am trying to concatenate a list of IDs into a varchar(max) to pass into an openquery for a bulk update of data.
My question is, is there an easy way to see if a string is beyond the length a varchar(max) can handle aside from comparing it to the number?
I have seen this: How many characters in varchar(max) which specifies the exact length of a varchar(max), but I was hoping for a simpler method than comparing length to a static numeric value.
Please let me know if any more information is needed.