views:

33

answers:

2

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.

+1  A: 

No, varchar(MAX) is NOT limited to 8000 characters, so you'll be fine.

Maximilian Mayerl
+2  A: 

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.

Adam Robinson