none
What is the FILESTREAM Windows share for?

    Question

  • Hi... When I set up FILESTREAM capabilities in SQL Server 2008, it asks for a Windows share name.
    What purpose does this serve and what folder is it mapped to? Why can I not view this share?

    Thanks for any information.
    Saturday, March 28, 2009 7:36 PM

Answers

  • Hi JFoushee,

    The Windows Share Name is used for writing and reading FILESTREAM data using Win32 API. If you use ParthName to return the path of a FILESTREAM BLOB, it will use the Windows Share Name to display the path, such as "\\SERVER\MSSQLSERVER\v1\PathNameExampleDB\dbo\TABLE1\FILESTREAMColumn\DD67C792-916E-4A76-8C8A-4A85DC5DB908(MSSQLSERVER is the Windows Share Name)". Then, the OpenSqlFilestream API uses this path to return a handle that an application can use to work with the BLOB data by using Win32 APIs. For more information, please see http://technet.microsoft.com/en-us/library/bb895239.aspx.

    In addition, the path is the fully qualified logical path of the BLOB while the directory of the FILESTREAM filegroup is a physical path for storing the data file.


    Hope this helps.

    Thanks.


    ***Xiao Min Tan***Microsoft Online Community***
    • Marked as answer by JFoushee Wednesday, April 01, 2009 12:04 PM
    Tuesday, March 31, 2009 9:47 AM

All replies

  • That share is used for the FILESTREAM feature, which is new for SQL Server 2008. It lets you store documents in the file system, and have SQL Server 2008 be able to access them and manage them almost as if they were stored inside the database.
    http://glennberrysqlperformance.spaces.live.com/ Please mark as the answer if this post solved your issue.
    Saturday, March 28, 2009 7:58 PM
  • Thanks for the quick response....

    Once I enable FILESTREAM for an instance, I receive the Windows share.

    But how can documents be stored on the Windows share when no path was tied to it at setup time?
    The Windows share cannot be tied to any particular network path, could it?

    I'm under the impression I store documents in the path I designate as the FILESTREAM filegroup, which is set up at database creation time...

    CREATE DATABASE myDB ON PRIMARY
    (NAME = N'myDB_Data.mdf' FILENAME = N'D:\MSSQL\mydb.mdf'),
    FILEGROUP Documents CONTAINS FILESTREAM DEFAULT
    (NAME = N'Documents', FILENAME = N'D:\MSSQL\Documents\mydb')

    LOG ON ...

    Remember, the fileshare existed before I created a database containing a FILESTREAM filegroup.

    Furthering the confusion, I create another database with a different FILESTREAM path....

    CREATE DATABASE myNewDB ON PRIMARY
    (NAME = N'myDB_Data.mdf' FILENAME = N'D:\MSSQL\mynewdb.mdf'),
    FILEGROUP Documents CONTAINS FILESTREAM DEFAULT
    (NAME = N'Documents', FILENAME = N'D:\MSSQL\Documents\mynewdb')

    LOG ON ...

    Ugh... now how are users going to designate a target database when they copy to the Windows share?
    So confused...
    Saturday, March 28, 2009 11:02 PM
  • This whitepaper from fellow MVP Paul Randal does a very good job of explaining how filestream access works, especially compared to storing blobs inside the database or in the NTFS file system.

    http://msdn.microsoft.com/en-us/library/cc949109.aspx


    http://glennberrysqlperformance.spaces.live.com/ Please mark as the answer if this post solved your issue.
    Monday, March 30, 2009 12:17 AM
  • It has some good info, but it says,
    1. If you want to read and write FILESTREAM data from Windows, click Enable FILESTREAM for file I/O streaming access. Enter the name of the Windows share in the Windows Share Name box.

    yet I still don't see the correlation to the Windows share to some random directory I specify for a database's FILESTREAM filegroup.

    Monday, March 30, 2009 12:19 PM
  • Hi JFoushee,

    The Windows Share Name is used for writing and reading FILESTREAM data using Win32 API. If you use ParthName to return the path of a FILESTREAM BLOB, it will use the Windows Share Name to display the path, such as "\\SERVER\MSSQLSERVER\v1\PathNameExampleDB\dbo\TABLE1\FILESTREAMColumn\DD67C792-916E-4A76-8C8A-4A85DC5DB908(MSSQLSERVER is the Windows Share Name)". Then, the OpenSqlFilestream API uses this path to return a handle that an application can use to work with the BLOB data by using Win32 APIs. For more information, please see http://technet.microsoft.com/en-us/library/bb895239.aspx.

    In addition, the path is the fully qualified logical path of the BLOB while the directory of the FILESTREAM filegroup is a physical path for storing the data file.


    Hope this helps.

    Thanks.


    ***Xiao Min Tan***Microsoft Online Community***
    • Marked as answer by JFoushee Wednesday, April 01, 2009 12:04 PM
    Tuesday, March 31, 2009 9:47 AM
  • Thank you.  This level of detail was very helpful.

    Wednesday, April 01, 2009 12:04 PM
  • Just following up on why I couldn't access the share myself.

    "Introducing SQL Server 2008" by DeBetta/Low/Whitehorn, page 100:

    The level of network access will affect the security on the share. If network access is enabled, then the share permissions are set for the special group "Authenticated Users". If network access is disabled, however, then the share still exists, but the Everyone group is explicitly denied access to the share. And if file I/O stream access is disabled, the share is removed from the server altogether.
    Thursday, April 09, 2009 12:03 AM