CREATE TABLE [dbo].[ImageInsert](
[ID] [int] IDENTITY(1,1) NOT NULL,
[Image] IMAGE -- or VARBINARY(MAX)
) ON [PRIMARY]
GO
INSERT INTO [dbo].[ImageInsert]([Image])
SELECT * FROM
OPENROWSET(BULK N'D:\image\ImageInsert.jpg', SINGLE_BLOB) AS Images
GO
Showing posts with label OPENROWSET. Show all posts
Showing posts with label OPENROWSET. Show all posts
Saturday, 30 May 2015
Insert Image into database from Folder using T-SQL in SQL Server by serverku
For the some project workaround I experienced with insert, some of the images into a database for need, You can do it with OPENROWSET,
Labels:
database,
image insert,
OPENROWSET,
script,
short notes,
SQL
Subscribe to:
Posts (Atom)