How can I insert binary file data into a binary SQL field using a simple insert statement?
问题 I have a SQL Server 2000 with a table containing an image column. How do I insert the binary data of a file into that column by specifying the path of the file? CREATE TABLE Files ( FileId int, FileData image ) 回答1: If you mean using a literal, you simply have to create a binary string: insert into Files (FileId, FileData) values (1, 0x010203040506) And you will have a record with a six byte value for the FileData field. You indicate in the comments that you want to just specify the file name