I have a table that has the following schema:
Create table TempMedia
id int Primary key,
mediaid int,
FileData varbinary(max)
This table has parts of the full file (we use a silverlight control to chunk the data to the web server)
We store the full file in another table:
create table Media
id int primary key,
FileData varbinary(max)
Is there are way to perform an insert into the Media table that concatenates the file parts completely in SQL, so we end up with the full file in the Media table? At the moment we combine these file parts by selecting the data from the TempMedia table and combining it on the web server and then inserting back to the Media table. Ideally we like to do this only on the SQL Server.