Germstorm Germstorm - 2 years ago 117
SQL Question

Insert Picture into SQL Server 2005 Image Field using only SQL

Using SQL Server 2005 and Management Studio how do I insert a picture into an

type column of a table?

Most importantly how do I verify if it is there?

Answer Source
    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
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download