USE DB
GO
CREATE TABLE Details(
Name nvarchar(255) NOT Null,
Type nvarchar(255) Null,
BinaryData varbinary(Max) Null,
Primary Key(Name)
) ON [PRIMARY]
EXEC sp_configure 'show advanced options', 1
RECONFIGURE
GO
EXEC sp_configure 'ad hoc distributed queries', 1
RECONFIGURE
GO
EXEC master.dbo.sp_MSset_oledb_prop N'Microsoft.ACE.OLEDB.12.0', N'AllowInProcess', 1
GO
EXEC master.dbo.sp_MSset_oledb_prop N'Microsoft.ACE.OLEDB.12.0', N'DynamicParameters', 1
GO
--JPEG
Insert Details([Name],[Type],[BinaryData])
Select 'IMAGE_040','Image file', BulkColumn from Openrowset( Bulk
'S:\ImageFolder\IMAGE_040.jpg', Single_Blob) as T
Insert Details([Name],[Type],[BinaryData])
Select 'IMAGE_042','Image file', BulkColumn from Openrowset( Bulk
'S:\ImageFolder\IMAGE_042.jpg', Single_Blob) as T
Insert Details([Name],[Type],[BinaryData])
Select 'IMAGE_053','Image file', BulkColumn from Openrowset( Bulk
'S:\ImageFolder\IMAGE_053.jpg', Single_Blob) as T
Question:
I want to add more images in SQL server but each time I need to write separate Insert command for each path.
Is their any command or any tool which can add more data in SQL server.
What I have tried:
Insert Details([Name],[Type],[BinaryData])
Select 'IMAGE_040','Image file', BulkColumn from Openrowset( Bulk
'S:\ImageFolder\IMAGE_040.jpg', Single_Blob) as T
Insert Details([Name],[Type],[BinaryData])
Select 'IMAGE_042','Image file', BulkColumn from Openrowset( Bulk
'S:\ImageFolder\IMAGE_042.jpg', Single_Blob) as T
Insert Details([Name],[Type],[BinaryData])
Select 'IMAGE_053','Image file', BulkColumn from Openrowset( Bulk
'S:\ImageFolder\IMAGE_053.jpg', Single_Blob) as T