These is the query i have found for inserting binary data (using varbinary) which is working perfectly
CREATE TABLE Employees
(
Id int,
Name varchar(50) not null,
Photo varbinary(max) not null
)
INSERT INTO Employees (Id, Name, Photo)
SELECT 10, 'John', BulkColumn from Openrowset( Bulk 'C:\photo.bmp', Single_Blob) as EmployeePicture
But what if the table employee has columns like:
CREATE TABLE Employees
(
Id int,
Photo varbinary(max) not null,
Name varchar(50) not null
)
[Photo column is 2nd over here!]
I tried manipulating the insert query but didnt help!!