SQL Filestream Retrieve File with VB or SQL

  • Hello,

    I want to use SQL Filestream to store files. I am a fairly novice developer and this is new. I have set up my database to store files and have successfully imported files with SQL and using Excel VB to execute the SQL. I would like to use Excel VB to export the file from SQL server to the local filesystem. Any starter code would be appreciated. I someone can recommend a good book that may have some examples that would be appreciated.

    Thank You

    • What kind of files, hierarchy, file size do you planing to store in the database?
    • What kind of metadata for the file's are you planing to store?

    In most cases, using a database to store files, is not a good solution, a filesystem has much better performance, backup and security for files.  You can easily end up with open transactions from your queries.  For Windows you may want to look at FileTables, that's probably more suitable for storing files in SQL server, and direct accessible from Excel, like a normal Windows file/directory setup. The FileTable feature builds on top of existing FILESTREAM capabilities, see compare table.

  • I agree. If you have a good use-case for Filestream then File Tables are the best way to implement it.

    Original author: https://github.com/SQL-FineBuild/Common/wiki/ 1-click install and best practice configuration of SQL Server 2019, 2017 2016, 2014, 2012, 2008 R2, 2008 and 2005.

    When I give food to the poor they call me a saint. When I ask why they are poor they call me a communist - Archbishop Hélder Câmara

Viewing 3 posts - 1 through 2 (of 2 total)

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