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
1
vote
0 answers

How to make Kubernetes container/pod running as GMSA account work with SQL Server FILESTREAM table

We have the following setup in our infrastructure: ASP.NET Core service running in a Windows container/pod running in Kubernetes on a domain-joined Windows host (we have tested with both nano and server-core images) Followed the documentation on…
1
vote
1 answer

Storing JSON in database column - NVARCHAR(MAX), FileStream?

I have a table with a few standard fields plus a JSON document in one of the columns. We use SQL Server 2017 to store everything and data is consumed by a C# application using Entity Framework 6. The table itself will possibly have tens of thousands…
user2384366
  • 1,034
  • 2
  • 12
  • 28
1
vote
0 answers

How to return SqlFileStream within TransactionScope and using or alternative solution needed, c#

public SqlFileStream GetStream(Guid streamedReportId, Guid orgReportId) { string tmpFileName = string.Empty; using (var ts = new TransactionScope(TransactionScopeOption.Required, TimeSpan.FromHours(1))) { using (SqlConnection…
nskater
  • 11
  • 3
1
vote
1 answer

SqlFileStream error after SQL Server 2016 (SP2-CU3) upgrade (the device is not ready

We've had this .NET component (.exe) running to migrate documents between 2 databases for almost a year. Console app is using the System.Data.SqlTypes.SqlFileStream .NET class to read/write from file system. After a recent upgrade of SQL Server to…
bakre381
  • 35
  • 5
1
vote
1 answer

FILESTREAM - Read and write a large file in FILESTREAM column

Should I use System.Data.SqlTypes.SqlFileStream to read and write a FILESTREAM column? For example: var sqlCommand = sqlConnection3.CreateCommand(); sqlCommand.CommandText = "Select FileData.PathName() As Path, GET_FILESTREAM_TRANSACTION_CONTEXT()…
Fred
  • 3,365
  • 4
  • 36
  • 57
1
vote
1 answer

How to attach a mdf file bypassing filestream information?

I have a mdf and ldf files from a database that in principle have filestream data too. Since i need to debug an issue related only to the relational tables and the filestream folder is too big I wonder whether there is a way to attach a db only from…
UnDiUdin
  • 14,924
  • 39
  • 151
  • 249
1
vote
1 answer

Recovering database with filestream

I had a database setup with a filestream. The filestream storage was on a separate drive than the datafiles. The server was migrated to virtual, and the drive letter unknowingly changed. The database went into 'Recovery Pending' mode. I didn't…
user568551
  • 337
  • 3
  • 11
1
vote
0 answers

FileStream after file is deleted in file explorer, then error in SQL

I set up FileSTream on my SQL Server database. Files were created on file system, that was all OK. Then due to some incident, some files were deleted off the file system. But SQL still points rows to files. When I try to set new bytes[] in…
bob
  • 774
  • 1
  • 7
  • 16
1
vote
1 answer

Saving to disc directyl from sqlFileStream or figuring out how to store large data inside one byte array

Hello I have been following numerous tutorials online for a new project I'm working on. I am obtaining my data from filestream and I'm getting an out of memory exception at this line: byte[] buffer = new byte[(int)sfs.Length]; What I'm doing is…
Meya
  • 21
  • 2
1
vote
1 answer

Retrieve a file from a SQL Filestream column using vb.net

To be honest, I don't have any idea how filestream works. It's my first time using and experimenting on it. So, I was able to store data in a filestream column, but I have no idea how to retrieve it or how it should look after retrieving it. Is it…
bananna
  • 13
  • 1
  • 5
1
vote
3 answers

Which problems exist when using 32bit applications that handle Office 2010 64bit files?

I am testing one application that handles files (stored in SQL Server using FILESTREAM). It is a Delphi 32bit application. Opening an XLS document stored in the database (originally saved with Office 2003) gives an error from Excel 2010 64bit. Is…
UnDiUdin
  • 14,924
  • 39
  • 151
  • 249
1
vote
1 answer

SqlFileStream - Which FileOption and allocation size?

I am using the SqlFileStream and when constructing the object I am not sure which FileOptions and allocation size to use. I got this from another article but it did not explain why. Can somone help explain or give me a recommendation? thanks! using…
Marco
  • 2,453
  • 3
  • 25
  • 35
1
vote
1 answer

Concurrent reads using SQLFileStream?

Using .Net 4.52 and SQL Server 2014 with FILESTREAM We have a webservice that is failing on concurrent reads with "System.InvalidOperationException: The process cannot access the file specified because it has been opened in another transaction." I…
1
vote
0 answers

Error when attaching SQL Server database from .mdf file (with filestream configured)

I had a an instance of SQL Server 2014 with filesteam on. Recently the machine was infected with a virus that basically decrypted all the files that were possible to modify, so SQL Server was broken. The administrator of the machine gave us a backup…
matt137
  • 169
  • 1
  • 14
1
vote
1 answer

Renaming ROWCOLGUID column when table has a FILESTREAM column

I have a table for storing document content with a FILESTREAM column, and another column which is a ROWGUIDCOL column (required when you have a FILESTREAM column). I want to migrate this table with its existing data, into a slightly new structure…
Simon Green
  • 1,131
  • 1
  • 10
  • 28