First lets analyze the concern: an embedded user name and password are more secure than using Windows Authentication. This is an embarrassingly wrong assumption. All it does it gives a false sense of security. As a matter of fact, one cannot hide a secret inside an application. It can always be revealed. In this day and age, all it take is one intrepid skillful hacker to reveal the embedded password, or the method how to retrieve it, and thanks to Google and friends everybody interested will learn it, no matter how unskillful he or she is. In a security analysis, a login and password 'hidden' on the user workstation should be considered as secure as if they were handed in writing to the said user. By using a hidden login and password as means to protect access all you achieve is you loose accountability and the track record of who did it, when they'll do it. Always rely on proper access rights for security protection. Never rely on obfuscated password that are 'hidden' on the very attacker's machine.
If you want a protection scheme that allows users only access to the specific functionality (ie. they can only update data in this way as opposed to writing arbitrary UPDATEs), use the good ole' tried and tested methods of ownership chains via stored procedures and grant only EXECUTE access to the true authenticated user. For an even better solution, use code signing.
As for the T-SQL vs. Win32 access, the FILESTREAM Best Practices document contains this wording:
- The FILESTREAM API is designed for
Win32 streaming access to data. Avoid
using Transact-SQL to read or write
FILESTREAM binary large objects
(BLOBs) that are larger than 2 MB. If
you must read or write BLOB data from
Transact-SQL, make sure that all BLOB
data is consumed before you try to
open the FILESTREAM BLOB from Win32.
Failure to consume all the
Transact-SQL data might cause any
successive FILESTREAM open or close
operations to fail.
- Avoid Transact-SQL statements that
update, append or prepend data to the
FILESTREAM BLOB. This causes the BLOB
data to be spooled into the tempdb
database and then back into a new
physical file.