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: http://stackoverflow.com/questions/1761124/how-many-characters-in-varcharmax 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.