Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

SSIS- Need File Name which i am loading in Variable Expand / Collapse
Author
Message
Posted Tuesday, October 09, 2012 1:04 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Yesterday @ 7:26 AM
Points: 24, Visits: 293
I Need File Name which i am loading via Excel. Any Idea
Post #1370546
Posted Tuesday, October 09, 2012 2:00 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 12:05 AM
Points: 5,688, Visits: 6,142
More information as to what you're trying to do, please. That's rather vague.


- Craig Farrell

Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

For better assistance in answering your questions | Forum Netiquette
For index/tuning help, follow these directions. |Tally Tables

Twitter: @AnyWayDBA
Post #1370572
Posted Wednesday, October 10, 2012 12:16 AM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Yesterday @ 2:11 AM
Points: 9,378, Visits: 6,473
vax09 (10/9/2012)
I Need File Name which i am loading via Excel. Any Idea


Are you using a For Each Loop?




How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1370698
Posted Wednesday, October 10, 2012 7:26 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, May 20, 2013 8:10 AM
Points: 9, Visits: 97
Hi

If you are trying to loop through files and load the data and the file name to the target table?
In that case Inside "derived column" toolbox you have Variables and Columns. Just add a derived column, lets say FileName, with the Variable value. When loading table, just map derived column FileName to the table column sourcefileName.

That way it worked for me, If this is not what you are looking for like Evil Kraig F said please elaborate your scenario so you can have better help.

Good Luck!!!
Post #1370917
Posted Wednesday, October 10, 2012 9:17 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Yesterday @ 7:26 AM
Points: 24, Visits: 293
NO i am just importing excel sheet and i need to use that excel sheet name in one column
Post #1371001
Posted Wednesday, October 10, 2012 9:18 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Yesterday @ 7:26 AM
Points: 24, Visits: 293
i am importing excel file and i want to use the name of excel file in my table
Post #1371002
Posted Thursday, October 11, 2012 1:28 PM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Yesterday @ 2:11 AM
Points: 9,378, Visits: 6,473
Does the name of the excel sheet change? I guess not, so you can just use a derived column component that adds a column with the name of the Excel file.



How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1371750
Posted Thursday, October 11, 2012 2:11 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, May 08, 2013 11:25 AM
Points: 121, Visits: 414
If the name doesn't change then I would just hardcode the name of the file into a variable and feed that through with a derived column. But I prefer to add a loop around the file extraction data flow and map the result set of your loop to a variable - just in case the name changes.

Post #1371770
Posted Friday, October 12, 2012 2:26 AM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Tuesday, May 21, 2013 4:23 AM
Points: 842, Visits: 741
Done this before. used a controlling/audit table. Loop through the folder and add the file names to the table. You can have other audit info you might need in the table as well. date, loaded flag etc.
then use this table to load the data.


Ian Cockcroft
MCITP BI Specialist
Post #1371943
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse