Monday, April 11, 2011

Can I append to a BLOB in MSSQL database from C# without reading the original data?

Hi,

I'd like to be able to append some data to a binary field in a MS SQL 2005 server from C# without reading the original data, concatenating it, and then setting it all back.

Is this possible?

Cheers! Steve

From stackoverflow
  • Well, I don't know for a BLOB, but for text you can do this:

    UPDATE tablename SET columnname=concat(columnname,' my extra text');

  • Read about the UPDATETEXT sql statement at http://msdn.microsoft.com/en-us/library/3517w44b.aspx. The Msdn article contains example code that appends binary data to a blob in the StorePhoto method.

0 comments:

Post a Comment