List of fallback values in SQL My question is what would be the best way to handle storing a list of values where the next serves as a fall-back. With a completely variable number of fall-backs (specified by our user). 

I'm aware storing a delimited list in one SQL field is considered an anti-pattern (such as a list of parameters), however in this case we have a folder name, and if that folder name does not exist, we will fall back to another specified folder name, so on and so forth until all given folder names have been exhausted or until the first working folder name is found. 

The order of the folder names tried is also important and must be preserved. Can't have it checking 99 before 8.
The simplest solution I can think of is to simply have a table folders with two columns: folder and priority. Simply

select folder
from folders
order by priority;


Then just try them in order and use the first folder that exists as a physical directory.

If folder in your current model is an attribute, then make the folders table a child table of that table; ie, if your current model is:

x (
   id,
   col1,
   col2,
   folder
)


then you should turn that into:

x (
    id,
    col1,
    col2
 )

 folders (
     x_id references x,
     folder,
     priority
  )


and the query becomes:

 select folder
 from folders
 where x_id = &lt;id&gt;
 order by priority;