Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3492512
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T11:46:02+00:00 2026-05-18T11:46:02+00:00

I have to store file paths in a DB field ( /tmp/aaa/bbb , C:\temp\xxx\yyy

  • 0

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 http://en.wikipedia.org/wiki/Comparison_of_file_systems and that http://msdn.microsoft.com/en-us/library/aa365247.aspx, depending on the file system there could be theoretically no length limit for a path.

I guess that defining this field as a LONGBLOB or VARCHAR(very high value) wouldn’t be wise. I’ve thought about something like VARCHAR(1024) which should be suitable for most frequent (even if not all) cases, and not too big as a DB field. What would you recommend ?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T11:46:03+00:00Added an answer on May 18, 2026 at 11:46 am

    You can use VARCHAR(MAX) or NVARCHAR(MAX).

    These are variable length fields meaning they are designed to store values of different length. There is no extra overhead for longer values over shorter values.

    Defining MAX means the field can be up to 2GB.

    From MSDN (varchar), nvarchar has similar documentation:

    Use varchar when the sizes of the column data entries vary considerably.

    Use varchar(max) when the sizes of the column data entries vary considerably, and the size might exceed 8,000 bytes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Some of the documents I store in Lucene have fields that contain file paths
I have a problem to Store file (from a remote API) in MongoDB, i'm
I have semicolon-separated .dat file and I want to read that file and store
I have an XML based file format that I'm using to store and load
I have used this code to store Object to a file: try{ FileOutputStream saveFile=new
I have a properties file in java, in which I store all information of
can I somehow add paths where Dwoo is looking for templates from? I have
I have seen several developers perform: string fileStore = Server.MapPath(@~\someDirectory); File.Create(fileStore + someFileName.xxx); I
I have a directory path stored in a text file, and I need to
I have a table, called 'files', where I store file_id's. Basically, users on my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.