In the previous post, we saw that how to load the Reading the files (PDF, word, excel text, etc.) From folder and loading it into the table using SQL script.
https://bageshkumarbagi-msbi.blogspot.com/2021/06/reading-files-pdf-word-excel-text-etc.html
In this post, we will see how we load the files
using SSIS.
Below are the files which we need to load into the table.
Taking Data flow task.
Taking Source as OLEDB source and selecting Data access mode
as SQL Command.
And writing the below sql script
DECLARE @file_nm VARCHAR(250), |
Now taking
Import column Transformation. And mapping the file path with leanageID.
Read here : Uploading the Image into sqlserver using SSIS
https://bageshkumarbagi-msbi.blogspot.com/2021/03/uploading-image-into-sql-server-using.html
Now taking
Oledb destination.
Now our
package is ready to run.
See the records in the table.
Let’s run the package.
Ooooooooooooooo
My package get failed.
Below is the error.
[OLE DB Source [34]] Error: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code:
0x80040E14. An OLE DB record
is available. Source: "Microsoft
SQL Server Native Client 11.0"
Hresult: 0x80040E14
Description: "SQL Server blocked access to procedure
'sys.xp_cmdshell' of component 'xp_cmdshell' because this component is turned
off as part of the security configuration for this server. A system
administrator can enable the use of 'xp_cmdshell' by using sp_configure. For
more information about enabling 'xp_cmdshell', search for 'xp_cmdshell' in
SQL Server Books Online.". |
USE MASTER GO EXEC sp_configure 'xp_cmdshell', 1; GO RECONFIGURE; |
Now running this package.
Package executed successfully.
See the records into the tables.
Files loaded successfully.