{"id":871,"date":"2009-05-06T13:47:00","date_gmt":"2009-05-06T13:47:00","guid":{"rendered":"\/blogs\/paul\/post\/Misconceptions-around-FILESTREAM-storage.aspx"},"modified":"2017-04-13T09:53:50","modified_gmt":"2017-04-13T16:53:50","slug":"misconceptions-around-filestream-storage","status":"publish","type":"post","link":"https:\/\/www.sqlskills.com\/blogs\/paul\/misconceptions-around-filestream-storage\/","title":{"rendered":"Misconceptions around FILESTREAM storage"},"content":{"rendered":"<p>\n<font face=\"verdana,geneva\" size=\"2\">This short post is prompted by a question that came in through Twitter &#8211; I *knew* it was worth joining and spending time on it (<\/font><a href=\"https:\/\/twitter.com\/PaulRandal\"><font face=\"verdana,geneva\" size=\"2\">http:\/\/twitter.com\/PaulRandal<\/font><\/a><font face=\"verdana,geneva\" size=\"2\">).<\/font>\n<\/p>\n<p>\n<font face=\"verdana,geneva\" size=\"2\">The (paraphrased) question is <em>&quot;can FILESTREAM data be stored remotely?&quot;<\/em>. This has been confusing people, and neither FILESTREAM BOL nor my FILESTREAM whitepaper (see <\/font><a href=\"https:\/\/www.sqlskills.com\/blogs\/paul\/sql-server-2008-filestream-whitepaper-published-on-msdn\/\"><font face=\"verdana,geneva\" size=\"2\">here<\/font><\/a><font face=\"verdana,geneva\" size=\"2\">) explicitly answer the question.<\/font>\n<\/p>\n<p>\n<font face=\"verdana,geneva\" size=\"2\">The FILESTREAM data container for a database must be placed on an NTFS volume on locally-connected storage. Just like database data and log files, the directory cannot be on a UNC share. The confusion comes from the fact that FILESTREAM data *can* be *accessed* remotely through a UNC share &#8211; but as far as the host instance is concerned, the FILESTREAM storage must be local.<\/font>\n<\/p>\n<p>\n<font face=\"verdana,geneva\" size=\"2\">A second question that came up a while ago is whether FILESTREAM data containers can share the same directory or be nested. The answers are kind-of, and no, respectively. Let&#39;s see.<\/font>\n<\/p>\n<p>\n<font face=\"verdana,geneva\" size=\"2\">I&#39;ll create the first database with a FILESTREAM data container:<\/font>\n<\/p>\n<blockquote>\n<p>\n\t<font face=\"verdana,geneva\" size=\"2\"><font face=\"courier new,courier\">CREATE DATABASE FileStreamTestDB1 ON PRIMARY<br \/>\n\t&nbsp;&nbsp;&nbsp; (NAME = FileStreamTestDB1_data, FILENAME = N&#39;C:\\SQLskills\\FSTestDB1_data.mdf&#39;),<br \/>\n\tFILEGROUP FileStreamFileGroup CONTAINS FILESTREAM<br \/>\n\t&nbsp;&nbsp;&nbsp; (NAME = FileStreamTestDB1Documents,&nbsp;FILENAME = N&#39;C:\\SQLskills\\FSDC\\Documents&#39;)<br \/>\n\tLOG ON <br \/>\n\t&nbsp;&nbsp;&nbsp; (NAME = FileStreamTestDB1_log,&nbsp;FILENAME = N&#39;C:\\SQLskills\\FSTestDB1_log.ldf&#39;);<br \/>\n\tGO<\/font>&nbsp;<\/font>\n\t<\/p>\n<\/blockquote>\n<p>\n<font face=\"verdana,geneva\" size=\"2\">And now let&#39;s try another database with the same parent directory:<\/font>\n<\/p>\n<blockquote>\n<p>\n\t<font face=\"verdana,geneva\" size=\"2\"><font face=\"courier new,courier\">CREATE DATABASE FileStreamTestDB2 ON PRIMARY<br \/>\n\t&nbsp;&nbsp;&nbsp; (NAME = FileStreamTestDB2_data, FILENAME = N&#39;C:\\SQLskills\\FSTestDB2_data.mdf&#39;),<br \/>\n\tFILEGROUP FileStreamFileGroup CONTAINS FILESTREAM<br \/>\n\t&nbsp;&nbsp;&nbsp; (NAME = FileStreamTestDB2Documents, FILENAME = N&#39;C:\\SQLskills\\FSDC\\Documents2&#39;)<br \/>\n\tLOG ON <br \/>\n\t&nbsp;&nbsp;&nbsp; (NAME = FileStreamTestDB2_log,&nbsp;FILENAME = N&#39;C:\\SQLskills\\FSTestDB2_log.ldf&#39;);<br \/>\n\tGO<\/font>&nbsp;<\/font>\n\t<\/p>\n<\/blockquote>\n<p>\n<font face=\"verdana,geneva\" size=\"2\">This works fine. You can&#39;t have another database use the *same* directory as the first database (i.e. N&#39;C:\\SQLskills\\FSDC\\Documents&#39;), but two FILESTREAM data containers can have the same parent directory.<\/font>\n<\/p>\n<p>\n<font face=\"verdana,geneva\" size=\"2\">And now let&#39;s try a nested one:<\/font>\n<\/p>\n<blockquote>\n<p>\n\t<font face=\"courier new,courier\" size=\"2\">CREATE DATABASE FileStreamTestDB3 ON PRIMARY<br \/>\n\t&nbsp;&nbsp;&nbsp; (NAME = FileStreamTestDB3_data, FILENAME = N&#39;C:\\SQLskills\\FSTestDB3_data.mdf&#39;),<br \/>\n\tFILEGROUP FileStreamFileGroup CONTAINS FILESTREAM<br \/>\n\t&nbsp;&nbsp;&nbsp; (NAME = FileStreamTestDB3Documents, FILENAME = N&#39;C:\\SQLskills\\FSDC\\Documents\\Documents3&#39;)<br \/>\n\tLOG ON <br \/>\n\t&nbsp;&nbsp;&nbsp; (NAME = FileStreamTestDB3_log,&nbsp;FILENAME = N&#39;C:\\SQLskills\\FSTestDB3_log.ldf&#39;);<br \/>\n\tGO<\/font>\n\t<\/p>\n<p>\n\t<font face=\"verdana,geneva\" size=\"2\"><font face=\"courier new,courier\">Msg 5136, Level 16, State 2, Line 1<br \/>\n\tThe path specified by &#39;C:\\SQLskills\\FSDC\\Documents\\Documents3&#39; cannot be used for a FILESTREAM container since it is contained in another FILESTREAM container.<br \/>\n\tMsg 1802, Level 16, State 2, Line 1<br \/>\n\tCREATE DATABASE failed. Some file names listed could not be created. Check related errors.<\/font><br \/>\n\t<\/font>\n\t<\/p>\n<\/blockquote>\n<p>\n<font face=\"verdana,geneva\" size=\"2\">Doesn&#39;t work, as expected, as this is documented in BOL <a href=\"https:\/\/msdn.microsoft.com\/Areas\/Epx\/Content\/500.htm?aspxerrorpath=\/en-us\/library\/bb933993.aspx\">here<\/a>.<\/font>\n<\/p>\n<p>\n<font face=\"verdana,geneva\" size=\"2\">Thanks<\/font><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This short post is prompted by a question that came in through Twitter &#8211; I *knew* it was worth joining and spending time on it (http:\/\/twitter.com\/PaulRandal). The (paraphrased) question is &quot;can FILESTREAM data be stored remotely?&quot;. This has been confusing people, and neither FILESTREAM BOL nor my FILESTREAM whitepaper (see here) explicitly answer the question. [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[41,61,86],"tags":[],"class_list":["post-871","post","type-post","status-publish","format-standard","hentry","category-filestream","category-misconceptions","category-sql-server-2008"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Misconceptions around FILESTREAM storage - Paul S. Randal<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.sqlskills.com\/blogs\/paul\/misconceptions-around-filestream-storage\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Misconceptions around FILESTREAM storage - Paul S. Randal\" \/>\n<meta property=\"og:description\" content=\"This short post is prompted by a question that came in through Twitter &#8211; I *knew* it was worth joining and spending time on it (http:\/\/twitter.com\/PaulRandal). The (paraphrased) question is &quot;can FILESTREAM data be stored remotely?&quot;. This has been confusing people, and neither FILESTREAM BOL nor my FILESTREAM whitepaper (see here) explicitly answer the question. [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlskills.com\/blogs\/paul\/misconceptions-around-filestream-storage\/\" \/>\n<meta property=\"og:site_name\" content=\"Paul S. Randal\" \/>\n<meta property=\"article:published_time\" content=\"2009-05-06T13:47:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-04-13T16:53:50+00:00\" \/>\n<meta name=\"author\" content=\"Paul Randal\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Paul Randal\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/misconceptions-around-filestream-storage\/\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/misconceptions-around-filestream-storage\/\",\"name\":\"Misconceptions around FILESTREAM storage - Paul S. Randal\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#website\"},\"datePublished\":\"2009-05-06T13:47:00+00:00\",\"dateModified\":\"2017-04-13T16:53:50+00:00\",\"author\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/misconceptions-around-filestream-storage\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.sqlskills.com\/blogs\/paul\/misconceptions-around-filestream-storage\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/misconceptions-around-filestream-storage\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Misconceptions around FILESTREAM storage\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#website\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/\",\"name\":\"Paul S. Randal\",\"description\":\"In Recovery...\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce\",\"name\":\"Paul Randal\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/0b6a266bba2f088f2551ef529293001bd73bf026bc1908b9866728c062beeeb6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/0b6a266bba2f088f2551ef529293001bd73bf026bc1908b9866728c062beeeb6?s=96&d=mm&r=g\",\"caption\":\"Paul Randal\"},\"sameAs\":[\"http:\/\/3.209.169.194\/blogs\/paul\"],\"url\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/author\/paul\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Misconceptions around FILESTREAM storage - Paul S. Randal","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.sqlskills.com\/blogs\/paul\/misconceptions-around-filestream-storage\/","og_locale":"en_US","og_type":"article","og_title":"Misconceptions around FILESTREAM storage - Paul S. Randal","og_description":"This short post is prompted by a question that came in through Twitter &#8211; I *knew* it was worth joining and spending time on it (http:\/\/twitter.com\/PaulRandal). The (paraphrased) question is &quot;can FILESTREAM data be stored remotely?&quot;. This has been confusing people, and neither FILESTREAM BOL nor my FILESTREAM whitepaper (see here) explicitly answer the question. [&hellip;]","og_url":"https:\/\/www.sqlskills.com\/blogs\/paul\/misconceptions-around-filestream-storage\/","og_site_name":"Paul S. Randal","article_published_time":"2009-05-06T13:47:00+00:00","article_modified_time":"2017-04-13T16:53:50+00:00","author":"Paul Randal","twitter_misc":{"Written by":"Paul Randal","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/misconceptions-around-filestream-storage\/","url":"https:\/\/www.sqlskills.com\/blogs\/paul\/misconceptions-around-filestream-storage\/","name":"Misconceptions around FILESTREAM storage - Paul S. Randal","isPartOf":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#website"},"datePublished":"2009-05-06T13:47:00+00:00","dateModified":"2017-04-13T16:53:50+00:00","author":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce"},"breadcrumb":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/misconceptions-around-filestream-storage\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlskills.com\/blogs\/paul\/misconceptions-around-filestream-storage\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/misconceptions-around-filestream-storage\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqlskills.com\/blogs\/paul\/"},{"@type":"ListItem","position":2,"name":"Misconceptions around FILESTREAM storage"}]},{"@type":"WebSite","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#website","url":"https:\/\/www.sqlskills.com\/blogs\/paul\/","name":"Paul S. Randal","description":"In Recovery...","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sqlskills.com\/blogs\/paul\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce","name":"Paul Randal","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/0b6a266bba2f088f2551ef529293001bd73bf026bc1908b9866728c062beeeb6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0b6a266bba2f088f2551ef529293001bd73bf026bc1908b9866728c062beeeb6?s=96&d=mm&r=g","caption":"Paul Randal"},"sameAs":["http:\/\/3.209.169.194\/blogs\/paul"],"url":"https:\/\/www.sqlskills.com\/blogs\/paul\/author\/paul\/"}]}},"_links":{"self":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/posts\/871","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/comments?post=871"}],"version-history":[{"count":0,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/posts\/871\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/media?parent=871"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/categories?post=871"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/tags?post=871"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}