I would go with generate script option in SQL Server Management Studio;
- Highlight source database that has the source table
- Right-click – Tasks | Generate Scripts
- Select source table under “Select specific database objects”. Click Next
- Click Advanced and under General options – Change ‘Type of data to script’ to “Data Only”
- Save to file.
I have tried a sample that store excel files as varbinary type. The output from scrpting process is ;
USE [MyDB]
GO
INSERT [dbo].[Document] ([DocumentId], [FileExtension], [FileName], [Doc_Content]) VALUES (N'3af2497c-a190-eb11-b1bb-000d3adde0a7', N'.xlsx', N'Sample-01.xlsx', 0x504B0304140006000800000021002FDCAF2EEC010000310D0000130008025B436F6E74656E745F54797065735D2E786D6C20A2040228A00002000000000000000000000000000000000000000000000000000000000000000000000000000000
Add to favorites