I'm passing a comma delimited list of ids to a stored procedure as a varchar(MAX). The problem is varchar caps at 8000 characters and the list could potentially be larger.
Is there a sql datatype where size doesn't matter? No pun intended.
I'm passing a comma delimited list of ids to a stored procedure as a varchar(MAX). The problem is varchar caps at 8000 characters and the list could potentially be larger.
Is there a sql datatype where size doesn't matter? No pun intended.
No, varchar(MAX) is NOT limited to 8000 characters, so you'll be fine.
varchar(MAX) does not cap at 8000 characters. It's a replacement for the text data type (which is now deprecated). The MAX is not just a shortcut for a constant value of 8000; it actually indicates that the variable should be able to store an arbitrarily large amount of data.
If you're declaring a varchar variable without MAX as the qualifier, though, it will cap at 8000.