A more efficient way would be to send only new data and let SQL server append it.
I don't think there is a way to do this with LINQ.
But in LINQ2SQL you can use a little trick and do something like:
Append(int fileID, byte[] bytesToAdd)
{
using (MyDataContext context = new MyDataContext())
{
context.ExecuteCommand("UPDATE [Files] SET [BinaryData] = [BinaryData] + {0} WHERE [Id] = {1}", bytesToAdd, fileID);
}
}
With Entity framework context it's:
Append(int fileID, byte[] bytesToAdd)
{
using (MyDataContext context = new MyDataContext())
{
context.ExecuteStoreCommand("UPDATE [Files] SET [BinaryData] = [BinaryData] + {0} WHERE [Id] = {1}", bytesToAdd, fileID);
}
}
Also, if it's binary data, I would use
varbinary(MAX)