Storing an Excel File in a SQL Server Database

If you have a table with an image data type field where you store an Excel file or any file for that matter, and you need to update a particular record with a new file, you can use OPENROWSET. UPDATE MyTable SET MyImageField = ( SELECT * FROM OPENROWSET(BULK N'C:\MyExcelFile.xls', SINGLE_BLOB) AS MyFile ) FROM …

Continue reading Storing an Excel File in a SQL Server Database

Advertisements