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
18
votes
2 answers

SQL Server 2008 FILESTREAM performance

I had some questions around the FILESTREAM capability of SQL Server 2008. What would the difference in performance be of returning a file streamed from SQL Server 2008 using the FILESTREAM capability vs. directly accessing the file from a shared…
John Livermore
  • 30,235
  • 44
  • 126
  • 216
14
votes
1 answer

Threading and SqlFileStream. The process cannot access the file specified because it has been opened in another transaction

I am extracting content of the Files in SQL File Table. The following code works if I do not use Parallel. I am getting the following exception, when reading sql file stream simultaneously (Parallel). The process cannot access the file specified…
Zuhaib
  • 1,420
  • 3
  • 18
  • 34
13
votes
3 answers

FileStream vs FileTable

I want to store images in a sql database. The size of the image is between 50kb to 1mb. I was reading about a FileStream and a FileTable but I don't know which to choose. Each row will have 2 images and some other fields. The images will never be…
Eelco
  • 339
  • 1
  • 3
  • 13
12
votes
4 answers

How can I generate an INSERT script for a table with a VARBINARY(MAX) field?

I have a table with a VARBINARY(MAX) field (SQL Server 2008 with FILESTREAM) My requirement is that when I go to deploy to production, I can only supply my IT team with a group of SQL scripts to be executed in a certain order. A new table I am…
Issa Fram
  • 2,556
  • 7
  • 33
  • 63
7
votes
2 answers

.NET Core support for SQL Server FILESTREAM

I'm in the process of upgrading an existing application to .NET Core (DNX SDK 1.0.0-rc1-update2) that uses SQL Servers FILESTREAM feature for reading/writing large BLOBs to the database. It uses the SqlFileStream class to achieve this however it…
lawst
  • 498
  • 3
  • 12
6
votes
1 answer

How to Save IFormFile to SQLServer FileStream Table

So either no one has tried to do this yet or I am just not finding anything on it. The old way you would upload a file is this: public class FileStorage { public string FileName { get; set; } public byte[] FileStore { get; set;…
Mr. Smileys
  • 63
  • 1
  • 1
  • 4
5
votes
1 answer

Using File Tables with Entity Framework as well as cascading functionality

SQL Server FileTable was first introduced in 2012, yet it is not supported by Entity Framework (either .NET Core or full .NET Framework). Using SQL Server FileTable or FileStream allow faster file uploads and downloads. I want to use FileTable with…
Imran Faruqi
  • 663
  • 9
  • 19
4
votes
2 answers

sqlFileStream System.ComponentModel.Win32Exception: The request is not supported

I have SQL server express 2008 SP1 on windows 7 (Version 6.1 Build 7601: Service Pack 1) and visual studio 2010. I am attempting to create a Stored Procedure CLR for inserting a file into a file stream using the following code. using System; using…
Jason
  • 41
  • 2
4
votes
1 answer

Is it possible to create a dummy filestream filegroup to study mdf content only?

My application has a database that I create from a backup file in this way: -- create empty db CREATE DATABASE MyNewDB -- restore on the empty db from file RESTORE DATABASE MyNewDB FROM DISK = 'c:\Temp\MyNewDB.bak' WITH REPLACE, MOVE…
UnDiUdin
  • 14,924
  • 39
  • 151
  • 249
4
votes
0 answers

SQL FILESTREAM and Connection Pooling

I am currently enhancing a product to support web delivery of large file-content. I would like to store it in the database, and whether or not I choose to FILESTREAM by BLOB, the following question still holds. My WCF method will return a stream,…
Adam
  • 4,159
  • 4
  • 32
  • 53
4
votes
3 answers

There was an unknown error applying the filestream settings. check the parameters are valid

I am getting the following error while trying to configure FileStream in SQL server 2012. There was an unknown error applying the filestream settings. check the parameters are valid. (0x80041008) I am configuring it using SQL server configuration…
Banketeshvar Narayan
  • 3,799
  • 4
  • 38
  • 46
4
votes
3 answers

SQL Server FileStream - How to acquire files path

I'm working on this application where I need to upload large data files to my SQL Server DB, and I've been using FileStream to do it more efficiently. I understand the files are stored directly into my system's folders (C:\CryptoDB). The thing is, I…
Tehort
  • 41
  • 1
  • 1
  • 2
3
votes
1 answer

SQL Server Filestream with django-mssql

I would like to use SQL Server Filestream feature to store files (mainly large images) from a Django application. Currently I am using django-mssql as the database backend for my Django project. I don't think there is any existing model field in…
3
votes
0 answers

"The transaction has aborted" exception

I have this code to write an image into SqlFileStream, string strFileId; using (var oTransaction = new TransactionScope()) { var oSqlParameter = new SqlParameter[5]; oSqlParameter[0] = new SqlParameter("@FileName", imageName); …
IBRA
  • 1,502
  • 3
  • 24
  • 56
3
votes
2 answers

SqlFileStream exception "An invalid parameter was passed to the function"

I'm getting this exception: An invalid parameter was passed to the function when trying to create new instance from SqlFileStream. code: var fileStream = new SqlFileStream(strSqlPath, bytArrContext, FileAccess.Write) I checked for all the…
IBRA
  • 1,502
  • 3
  • 24
  • 56
1
2 3 4 5 6 7