SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Filetable paths


Filetable paths

Author
Message
tom.w.brannon
tom.w.brannon
SSCommitted
SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)

Group: General Forum Members
Points: 1530 Visits: 1362
I disagree with the answer and believe it should be nvarchar. The documentation at http://technet.microsoft.com/en-us/library/gg492084.aspx shows that the path_locator is hierarchyid, but the name, which is defined as 'The file or directory name. ' is nvarchar. I could use the name to find something, not the hierarchyid.
Thomas Abraham
Thomas Abraham
SSCrazy
SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)

Group: General Forum Members
Points: 2717 Visits: 2255
Nice question. Had to do the research, as never had a chance to use them. I can see how the could be used. But doubt I'll ever have any need for them where I work.

Thanks Steve!

Please don't go. The drones need you. They look up to you.
Connect to me on LinkedIn
bkmsmith
bkmsmith
Ten Centuries
Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)

Group: General Forum Members
Points: 1022 Visits: 854
gbritton1 (5/13/2014)


I'm still not sure how to extract that actual path (i.e. conventional Windows path name)


During my investigation on this question, I came across documentation on the FileTableRootPath function. "It returns the root-level UNC path for a specific FileTable or for the current database".

http://technet.microsoft.com/en-us/library/gg509104.aspx

I don't know if this is what you were specifically referring to. I am new to FileTables and have not used this functionality yet.

Regards,

Brian

EDIT: forgot to add the URL reference.
Steve Jones
Steve Jones
SSC Guru
SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)

Group: Administrators
Points: 62380 Visits: 19102
I've run into a few people using this, and Filestream. For Filestream it's mostly been .NET programmers that write thick apps and want drag/drop, easy storage of lots of images.

For Filetables, I've met a few early adopters that used it for Dfs replacements, moving files around on shares and syncing them with AlwaysOn.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Revenant
Revenant
SSCertifiable
SSCertifiable (7.3K reputation)SSCertifiable (7.3K reputation)SSCertifiable (7.3K reputation)SSCertifiable (7.3K reputation)SSCertifiable (7.3K reputation)SSCertifiable (7.3K reputation)SSCertifiable (7.3K reputation)SSCertifiable (7.3K reputation)

Group: General Forum Members
Points: 7336 Visits: 4860
With a little help from BoL... Thanks, Steve!
pchirags
pchirags
SSCrazy
SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)

Group: General Forum Members
Points: 2347 Visits: 615
nice question steve.
Anipaul
Anipaul
SSCertifiable
SSCertifiable (7.3K reputation)SSCertifiable (7.3K reputation)SSCertifiable (7.3K reputation)SSCertifiable (7.3K reputation)SSCertifiable (7.3K reputation)SSCertifiable (7.3K reputation)SSCertifiable (7.3K reputation)SSCertifiable (7.3K reputation)

Group: General Forum Members
Points: 7295 Visits: 1407
Nice to know...



Bangla
Bangla
SSCommitted
SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)

Group: General Forum Members
Points: 1695 Visits: 180
New to me too....
TomThomson
TomThomson
SSChampion
SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)

Group: General Forum Members
Points: 14280 Visits: 12197
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

Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search