December 12, 2014 at 12:36 pm
robertdba (12/12/2014)
Sorry that is the write one.SELECT @Cmd = REPLACE(REPLACE(
'DIR "C:\Car\CarSubfolder\*.jpg" /s /b'
,'C:\Car\CarSubfolder\',@pFullPath)
,'jpg',@pExtension)
;
INSERT INTO dbo.LoadedImage
(Folder, SubFolder, Name, Photo)
SELECT Car,CarSubfolder,<<Name>>,blob.BulkColumn
FROM OPENROWSET(BULK "C:\Car\CarSubfolder\", SINGLE_BLOB) blob
;'
,'"' ,'''')
,'C:\Car\CarSubfolder\',FUllPathName)
,'Car',QUOTENAME(Folder,''''))
,'CarSubfolder',QUOTENAME(SubFolder,''''))
,'<<Name>>',QUOTENAME([FileName],''''))
You shouldn't have to make such changes. I provided a stored procedure that simply takes parameters and makes all of the correct substitutions.
--Jeff Moden
Change is inevitable... Change for the better is not.
December 12, 2014 at 2:19 pm
So there might something wrong with the query, when I ran it without any changes just the way it is nothing is loaded, maybe I am missing something here.
Anyways thanks for the help and apologies for taking your time.
All the best
December 12, 2014 at 5:46 pm
robertdba (12/12/2014)
So there might something wrong with the query, when I ran it without any changes just the way it is nothing is loaded, maybe I am missing something here.Anyways thanks for the help and apologies for taking your time.
All the best
It may be because you might not be used to someone providing a complete solution. The script I provided creates a stored procedure. For how to use the stored procedure, see the section in the header of the proc under "Example Usage":.
The script also requires that you first execute the code to create the two functions that I also provided code for.
Before continuing, please take the time to read the header of the stored procedure.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 3 posts - 16 through 17 (of 17 total)
You must be logged in to reply to this topic. Login to reply