O'Reilly logo

Programming Microsoft® SQL Server™ 2008 by Leonard Lobel, Andrew Brust, and Stephen Forte

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The OpenSqlFilestream Native Client API

With an understanding and appreciation of how FILESTREAM is implemented internally by SQL Server, we’re ready now to move forward and store real binary picture data in the Photo column. As we mentioned earlier, this is best achieved by writing client code that calls the OpenSqlFilestream function provided by the SQL Server native client API.

When you work with OpenSqlFilestream, you always work with transactions (even for read access). There is no way to avoid them, since FILESTREAM by design coordinates transactional integrity across structured and unstructured data access between SQL Server and the NTFS file system. (However, we should stress that you normally should try not to read while in a transaction ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required