Is there a way to insert binary data into sql server directly from SQL Server management studio?
+1
A:
Found the answer:
SQL Server has an "OPENROWSET" command that accepts a filepath.
eg
Update myTable
set Image = (
SELECT *
FROM OPENROWSET(BULK N'C:\image.png', SINGLE_BLOB) test)
where ImageID = 1
Source: http://shortfastcode.blogspot.com/2009/12/insert-binary-data-like-images-into-sql.html
Daniel
2009-12-15 09:07:05
This requires that OPENROWSET is enabled on the server - it is disabled by default.
Ed Harper
2009-12-15 09:18:45
+1
A:
Try this:
INSERT INTO Table (field1) VALUES (0xABCDEF)
Where 0xABCDEF
is your binary data represented as an hexadecimal sequence.
Rubens Farias
2009-12-15 09:08:47