BKennedy2008
asked on
SQL Insert Statement with SUBSTRING inside a SSIS package
Below is the diagram that takes an excel file and imports into a SQL Database. Along with that is a filepath from a derived column. Inside that filepath contains the jobnumber. Instead of importing the whole path, I just want to extract the Job number wich SUBSTRING (Filepath, 51,12) will work.
I have an OLEDB command that contains the SQL statement to insert (Colum1, column2) values (?,?) into the SQL DB
I understand the SQL Statment using SUBString:
Insert into tableA (Column1, Filepath)
Select Column1, SUBSTRING (Filepath, 51,12) as FilePath from ......
What would be the name of the table that I am selecting from inside the OLEDB Command?
I have an OLEDB command that contains the SQL statement to insert (Colum1, column2) values (?,?) into the SQL DB
I understand the SQL Statment using SUBString:
Insert into tableA (Column1, Filepath)
Select Column1, SUBSTRING (Filepath, 51,12) as FilePath from ......
What would be the name of the table that I am selecting from inside the OLEDB Command?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The OLE DB doesn't like the statement:
INSERT INTO Imports (RosterName, FilePath1)
Select ?,SUBSTRING(?,51,12) from ['Raw Data$']
Does this look correct? the error is unspecified, pretty sure it has to do with the statement
INSERT INTO Imports (RosterName, FilePath1)
Select ?,SUBSTRING(?,51,12) from ['Raw Data$']
Does this look correct? the error is unspecified, pretty sure it has to do with the statement
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Just noticed this one: you'd get much better performance if you'd use the OLE DB Destination instead of Command (which works row per row).
ASKER
Performing a substring closest to the source saves memory space, and is cleaner
ASKER