don't understand why people think they need to write a CLR for this
Why not use native T-SQL commands?
Don't know that you'd want to, but maybe mass loading a whole bunch of files, something like:
INSERT FileDataTable(FileName, FileData)
SELECT FileName, clr.GetFileData(FileName) FROM FileNameTable
UPDATE FileTable SET FileData = clr.GetFileData(FileName)
? (I'm not sure this would even be possible - it's been a while since I personally looked into CLR functions?)
Re: the discussion about to FILESTREAM or not to FILESTREAM. What Jeff said:
For those cases where you're not going to violate the 2GB limit, you don't even need FileStream
Why would you want to complicate your life by introducing FILESTREAM if you don't need it? I suspect the scenarios where people are wanting to store > 2GB files are several orders of magnitude smaller than those scenarios where people are storing files documents and images < 2GB in size.
I know some people have an aversion to storing large blobs inside a SQL database, but I've never really understood it; you still need the same about of space for your data, and for the projects I've been involved with (a very small sample, I admit) nobody has yet commented about the performance.