Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 Raw file path through variable

Author  Topic 

lionofdezert
Aged Yak Warrior

885 Posts

Posted - 2010-03-25 : 02:44:34
I need to extract data from source tables to a RAW FILE... I need to provide file path through variable in follow form:

@Path = 'C:\ExtractedData\' + SourceTableName + '.txt'

how to provide source table name and do this concatenation.

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-03-25 : 05:00:52
Is the sourece table name changing?
If yes then how is it changing?


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

lionofdezert
Aged Yak Warrior

885 Posts

Posted - 2010-03-25 : 05:46:34
Basically i have only 5 fixed name tables to extract data from, so their name will remain same.
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-03-25 : 06:38:41
To ask my question in another way:
Why it is not possible to do:
@Path = 'C:\ExtractedData\SourceTableName.txt'

Where is the problem?


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

lionofdezert
Aged Yak Warrior

885 Posts

Posted - 2010-03-25 : 07:06:12
One thing... its my first package in SSIS ;)

Second: my variable @path contains only FOLDER path, tht means 'C:\ExtractedData\' and for every file i have to add 'source table table' and '.txt' extension to complete the path.

How to concatinate text (source table name and extension) with variable, when assigning FILE PATH to raw file at RAW FILE DESTINATION EDITOR page
Go to Top of Page

lionofdezert
Aged Yak Warrior

885 Posts

Posted - 2010-03-29 : 02:23:13
???
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-03-29 : 04:41:37
Click on your Connection Manager and see the properties window at the right side of your Visual Studio screen.
Expand Expressions and then click on [...] and the Property Expression Editor will open.
In Property column choose ConnectionString and then click on [...] and the Expression Builder will open.
In the Expression box type in your concatenation (for example: @path + "what_you_want_as_filename.txt")
Click on Evaluate Expression to see if it works.
Click OK.
Maybe some other mates here can give a better advice.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

lionofdezert
Aged Yak Warrior

885 Posts

Posted - 2010-03-29 : 05:46:36
Thanks a loooooooooooooooooooooooooooooooot..... webfreb

You definitely resolved my problem...
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-03-29 : 06:03:06
Oh - that's fine, my pleasure


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -