Friday, November 07, 2008

SQL Server 2008 FileStream and VB.Net – The Sample

Dave Noderer's Blog - SQL Server 2008 Filestream and vb.net

“I’ve become interested in a few aspects of SQL Server 2008. One is the new FILESTREAM datatype.

The basic idea is to have a SQL datatype you can use in queries and searches and is managed by SQL but which does not have any particular size limitation.

There are a number of articles on the multiple  steps it takes to setup a database  to utilize the new FILESTREAM features. I’m not going to cover that in this article. I highly recommend reading Paul Randal’s white paper on the subject, now published on MSDN: http://msdn.microsoft.com/en-us/library/cc949109.aspx. Both he and Kim  Tripp have lots of great SQL server content online at www.sqlskills.com. Paul also has some performance graphs of that will give you an idea of when to use FILESTREAM vs image or text.

Unfortunately there is very little on how to actually utilize the FILESTREAM from a programming standpoint. Most of them show how to utilize Win32 API and the SafeFileHandle, I only found one (I’m sure there are more) that talked about using the managed interface, SQLFileStream.  You can find that paper at: http://blogs.microsoft.co.il/blogs/bursteg , this was also all C#, not VB.

So I have created a vb project which illustrates using FILESTREAM… The presentation, visual  studio project and sql script can all be found here: …”

While I could convert past reference C# FileStream samples into the language I dream in (yes, VB & T-SQL… sigh… I so need a life ;) why convert when Dave has already done such a great job with the heavy lifting? 

Make sure you grab the referenced zip as it has the T-SQL and VB all packaged nicely for you…

 

Related Past Post XRef:
SQL Server FileStream Whitepaper – A DBA/IT focused FILESTREAM paper
Run to Run As Radio for a great SQL Server 2008 FILESTREAM show
SQL Server 2008 FILESTREAM Attribute from Start to C#
SQL Server 2008, the FILESTREAM Attribute and Partitioning - Apparently not as easy as it looks (yet at least)...
A future world without the SQL Server Image/Text/NText data types. Now's the time to start planning for that future...
SQL Server 2008 FILESTREAM - Writing a file to a FILESTREAM column
More SQL Server 2008 FileStream Fun
Playing with the SQL Server 2008 FileStream Attribute

No comments: