Questions tagged [sqlfilestream]

SqlFileStream is a class that exposes SQL Server data that is stored with the FILESTREAM column attribute as a sequence of bytes.

The SqlFileStream class is used to work with varbinary(max) data stored with the FILESTREAM attribute in a SQL Server 2008 database. You must install the .NET Framework 3.5 SP1 (or later) to use System.Data.SqlTypes.SqlFileStream to work with FILESTREAM data.

Specifying the FILESTREAM attribute on a varbinary(max) column causes SQL Server to store the data in the local NTFS file system instead of in the database file. Transact-SQL statements provide data manipulation capabilities within the server, and Win32 file system interfaces provide streaming access to the data.

MSDN doc

102 questions
3
votes
1 answer

Stream SqlFileStream via WebAPI

I have setup a SQL database with FILESTREAM support and am trying to stream files retrieved from the database with SqlFileStream through WebAPI to the browser. For some reason it does not work, but I get no proper error message. The browser just…
magnattic
  • 12,638
  • 13
  • 62
  • 115
2
votes
1 answer

MS Access / SQL Server - VBA: Upload local file to filestream on remote SQL server

I need to upload a file (<10 MB) around once a week to a SQL Server 2016 database on a remote server in the same network. Until now it was all within a Access FE/BE but I want to migrate to SQL Server as backend. The attachments I had in MS Access…
karlo922
  • 141
  • 8
2
votes
1 answer

How can I read SQL Server filestream with ASP.NET Core

I'm looking for a way to convert Pic.PathName() and GET_FILESTREAM_TRANSACTION_CONTEXT() to provide a link for downloading in ASP.NET Core. I have seen SqlFileStream in .NET Framework, but it does not work in .NET Core.
Reza Yousefi
  • 148
  • 11
2
votes
0 answers

Parallel read of SQL Server FileStream not working

I am trying to read the same SQL Server file stream in parallel threads, but am having no success. Mostly I get the following exception (although from time to time I get a other errors): System.InvalidOperationException: "The process cannot access…
2
votes
2 answers

How to enable SQL Filestream using Powershell

I'm spinning up a SQL server ready for deployment. Using AWS userdata, everything is being configured to this stage using PowerShell. However, the database needs to have Filestream enabled at level 2, but I can't find a way to do this using…
Dicky Moore
  • 956
  • 3
  • 10
  • 32
2
votes
1 answer

sqlfilestream - getting blob data from SQL Server and saving the file locally to disk

I have the following scenario: I have successfully saved my files(various extensions) into my sql server db using FILESTREAM. These can be anything from an image, to a word doc, pdf etc. now i want to retreive them and save them as a file to my…
2
votes
0 answers

How can I run vb.NET code from within Access 2010 (vba)? Accessing win 32 OpenSqlFilestream API through vb.NET, within Access 2010

thanks for your time good people! I am adapting an Access 2010 client to work with a new SQL Express Server 2008 back end. The back end is up and running. No problems there. Filestream is configured and working fine. My problem relates to acessing…
Patrick Quigley
  • 404
  • 2
  • 12
2
votes
0 answers

Why does altering a FILESTREAM column to not null duplicate file system data?

I have a table that holds file data in a varbinary(max) column, and am in the middles of converting this to use a FILESTREAM column in order to save the data on the filesystem. As part of this I have a SQL update script which adds the new FILESTREAM…
Jamie Pollard
  • 1,571
  • 1
  • 10
  • 21
2
votes
0 answers

SqlFileStream -- Win32Exception: "Access is denied" -- Impersonation

My goal here is to have an attachments manager that (1) effectively uses SQL FILESTREAM as it was designed, (2) restricts access to the SQL FileTable and its underlying FILESTREAM Windows directory to one of two Active Directory accounts (creds…
J.D. Mallen
  • 4,339
  • 3
  • 22
  • 33
2
votes
1 answer

GET_FILESTREAM_TRANSACTION_CONTEXT() is null

I'm having issues getting a file from a FILESTREAM varbinary(max) column. I added it to a table using this: ALTER TABLE [dbo].News ADD RowGuidColId UNIQUEIDENTIFIER ROWGUIDCOL NOT NULL UNIQUE DEFAULT (NewId()) GO ALTER TABLE News ADD…
Lasse Edsvik
  • 9,070
  • 16
  • 73
  • 109
2
votes
1 answer

Stream an (SqlFile-)Stream using Nancy

I was wondering how to send an (in my case) SqlFileStream directly to the client through our Nancy-API without loading the stream in memory. So far I succeeded in passing the stream, but Nancy's StreamResponse copies the sourcestream…
Guillaume Schuermans
  • 906
  • 2
  • 12
  • 28
2
votes
1 answer

Change database options during EF migration

We have some POCO classes and migrations enabled for my dataaccess layer we have created a initial migration to - remark we use the CreateDatabaseIfNotExist db initialization. But in the database I would like have a MessageBody field that uses SQL…
2
votes
1 answer

SQL Server : deleting FIELSTREAM files and num_unprocessed_items

I'm trying to delete the actual binaries from the file system while using SQL Server FILESTREAM. When doing so (and after removing all records that refers the BINARIES table) and running EXEC sp_filestream_force_garbage_collection the …
Burgaz
  • 237
  • 7
  • 14
2
votes
0 answers

Unable to read SqlFileStream data

I want to read Filestream column form Sql database. After reading I want to show the file content in a TextBox. In case of .txt file it is working fine but in other type like pfd or doc it is not readable. Here is the code: SqlConnection objSqlCon =…
2
votes
1 answer

Using SQL Server Filestream with LINQ

Accessing a BLOB file in the database using LINQ works like this: var query = from file in database where file.FileID = fileId select file; When I activate Filestream on this table LINQ queries the database via T-SQL. Which is a bad practice on…
Vulcano
  • 415
  • 10
  • 25