How do I INSERT binary data from a local file with SQLCMD?
问题 I need to insert binary data from a file into a varbinary(max) column in SQL Server as a part of my deployment script. The file is on the local machine, SQL Server is on the remote. Here is the data table definition CREATE TABLE [dbo].[Config] ( [ID] INT IDENTITY (1, 1) NOT NULL, [Name] NVARCHAR (50) NOT NULL, [Cfg] VARBINARY(MAX) NOT NULL ); I need something like this pseudo-command INSERT INTO Config(ID, Name, Cfg) VALUES (0, 'Default', ????('Default.cfg')??? ) i.e. data is taken from a