Sqlserver
 sql >> Datenbank >  >> RDS >> Sqlserver

Fügen Sie ein Bild in das SQL Server 2005-Bildfeld ein, indem Sie nur SQL verwenden

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