I have to store file paths in a DB field (/tmp/aaa/bbb
, C:\\temp\\xxx\\yyy
, etc.). I can\'t really tell how long they could be.
Given this
The field should be the same length as the length of a box of string.
As asking the length of a filename is like asking the length of a bit of string, asking the length of a path is like asking the length of all bits of string in a box of unknown size.
So the only sensible option given no other information is not to limit the length e.g. NVARCHAR(MAX)