Database design : preferred field length for file paths

前端 未结 7 936
南笙
南笙 2021-01-04 02:49

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

7条回答
  •  醉梦人生
    2021-01-04 03:42

    The Length of a file path cannot be predicted. It could be very short as 'C:\' or could be very lengthy like 'C:\Program Files\Microsoft SQL Server\110\LocalDB\Binn\Resources\1033' or even more. But in database level there is no harm using something like VARCHAR(MAX)

    See Maximum size of VARCHAR(MAX)

提交回复
热议问题