I created simple table:
SHOW DATABASES; CREATE DATABASE observe; USE observe; CREATE TABLE `see_me` (id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, name VARCHAR(20), food VARCHAR(30), confirmed CHAR(1), signup_date DATE, file_contents LONGBLOB // or VARBINARY(MAX) ); and a file called t.txt. How can I insert the file into the field file_contents with sql commands and extract it likewise into a file?
The insert may be something like
INSERT INTO see_me(id, file_contents) SELECT '1', BulkColumn FROM OPENROWSET (BULK '/Users/usr_00/lab/t.txt', SINGLE_BLOB) as ...; Can someone advise?