I have a sql server database that stores txt files in a varbinary column. I have a gridview controller (C#) that lists the files that are stored. What I would like to have happen is this: if a two or more files are selected from the gridview, the app or the database (doesnt matter to me) will concatentate all of the selected files content into one file that the user can download.
so if file one is a text file that contains the word "Hello" and File two is a text file the contains the word "world", the application will read content from both and create a new test file that contains "Hello World"
all suggestions welcome.
One way you could accomplish this is by having the query concatenate the data for you and create the file from that.
Such as,
select convert(varchar(1024), varbinaryA) + convert(varchar(1024), varbinaryB) from A_Table