Filetable paths

  • nice question steve.

  • Nice to know...

  • New to me too....

  • Interesting question. This is a feature I haven't yet used, so I had to do some reading, so it was useful for me.

    At first I found myself wondering what the "path" intended by the question was.

    Should it be the result of calling FileTableRootPath ( <FileTable_name>, 1)? The wording of the question asks for "stores the path for files in a filetable", not for "the path for a file in a filetable" so maybe it ought to mean that?

    But of course it may be using "files" to mean that the (single) path for each file in which case it could mean the result of calling path_locator.PathName(2,0) where path_locator is the attribute of the row in the table that corresponds to the file.

    Alternatively, "in the table" could qualify the verb "stores" instead of qualifying "files", which at first site seems just as likely as the other interpretations, and would mean that a path would the value of the relevant attribue (path_locator) of the row in the table that corresponds tofile .

    So there are the three options for interpreting the question, one refers to a column in the table which has type hierarchyid, and two refer to nvarchar strings which are presumably stored somewhere in metadata as nvarchar. Almost time to toss a coin (if I could find a three-side one)!

    But then my pedantic inclination kicked in: if I assumed that the question author would not have referred to "files in a filetable" because the filetable contains information about files (and directories) and doesn't contain not the files (and directories) themslves onlt the third interpretation is possible. Against that, I can imagine someone claiming that the value of the path_locator oject isn't a path, but a path locator - but to me that would be a silly argument because a path can have several representations: is the full machine name used, or just the terminal part? is the server name to be all upper case (NETBIOS format) or not? is the path to be relative to a root (other than the domain containing the server)? And so on - given there's no fixed representation of the path, there's nothing wrong with any representation that works.

    So I ended up getting deciding the path was the value of the path_locator attribute, so that its type was hierachyid; fortunately for my point score that was the right answer.

    I'm not sure how anyone would get to that answer without being careful as to how to interpret the phrase "in the table" in the question. Given that so far only a third of people trying it have got that answer, I think the question is probably harder than Steve intended it to be.

    Tom

Viewing 4 posts - 16 through 18 (of 18 total)

You must be logged in to reply to this topic. Login to reply