Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
Data Warehousing
»
Integration Services
»
Flat File connection Manager - File Name, The...
13 posts, Page 1 of 2
1
2
»»
Flat File connection Manager - File Name, The Folder in File Name changes every time the package is reopoened and needs resetting
Rate Topic
Display Mode
Topic Options
Author
Message
Debbie Edwards
Debbie Edwards
Posted Thursday, February 21, 2013 5:53 AM
SSC-Addicted
Group: General Forum Members
Last Login: Wednesday, May 22, 2013 4:50 AM
Points: 423,
Visits: 633
Very strange issue.
I have SQL Tables and Im using a For Loop to split the table up via a variable and sent data to different CSV Files.
In the connection Manager its self I have juse added an example folder and file name
The data is split via a variable, and another variable creates the CSV Name in the Flat File connection Managers properties - Expressions - Connection String.
However when I save and close and then I go back in, within File Name, the folder has changed (Not the example file name given) just the folder. This means every time I open it up I have to go back in and reset the folder.
Its never the same folder either. If I run without doing this I cant figure out where the files are being sent too.
Has any one got any clues as to what I can do to sort this out.... or test?
Debbie
Post #1422516
Daniel Bowlin
Daniel Bowlin
Posted Thursday, February 21, 2013 8:06 AM
SSCrazy
Group: General Forum Members
Last Login: 2 days ago @ 8:36 AM
Points: 2,681,
Visits: 2,423
Can you give a few examples of the folder names being generated? Also double check your file name expressions, maybe you have a missing \ or something. Is the folder supposed to be a fixed name? If it is driven from a variable with an expression that might be the issue.
Post #1422612
Debbie Edwards
Debbie Edwards
Posted Thursday, February 21, 2013 8:27 AM
SSC-Addicted
Group: General Forum Members
Last Login: Wednesday, May 22, 2013 4:50 AM
Points: 423,
Visits: 633
Its very strange. Its gone to about 3 different places. Almost like the last folder I was looking at when I was working on a different project.
I realised I needed to go to the flat file connection properties and expressions. For the connection String property it was set to just @[User::DFES_NAME_DATE_File_Name]+".csv"
So basically the file name with no folder attached.
I tried to change this to
"\\D-fs11\\spar-it\PROJECTS\\1 Active Projects\\DATA WAREHOUSING PROJECT\\Development\Extract_To_CSV\\"+@[User::DFES_NAME_DATE_File_Name]+".csv"
And was told that the token [Square bracket symbol] was not recognised. So I took that to mean the spaces in the folder names. I tried replacing them but nothing helped.
I then tried using another variable as the folder name so used the variable @Folder_Name which was already set with the actual folder name. This seemed to be good but when I ran it, the file names were created with [User::DFES_NAME_DATE_File_Name] twice but the first one was the same one every time and the second one was looped so this completely lost me.
So as yet I havent sorted it and worse Ive spent nearly all day trying to figure it out which is a massive waste of time on such a small thing.
Post #1422625
kl25
kl25
Posted Thursday, February 21, 2013 8:43 AM
SSC Veteran
Group: General Forum Members
Last Login: Yesterday @ 2:10 PM
Points: 262,
Visits: 1,167
These are tough problems to troubleshoot. For me, they've always been some small part of a variable or an expression. You've probably looked at the following but just in case...
I tried to change this to
"\\D-fs11\\spar-it\PROJECTS\\1 Active Projects\\DATA WAREHOUSING PROJECT\\Development
\
Extract_To_CSV\\"+@[User::DFES_NAME_DATE_File_Name]+".csv"
Notice the single backslash. That would probably lead to the token not recognized message. [Edit note:] My attempts to highlight the backslash aren't working very well. It's between 'Development' and 'Extract_To_CSV'.
I then tried using another variable as the folder name so used the variable @Folder_Name which was already set with the actual folder name. This seemed to be good but when I ran it, the file names were created with [User::DFES_NAME_DATE_File_Name] twice but the first one was the same one every time and the second one was looped so this completely lost me.
I fought through a loop naming problem like this just recently. It turned out that I had added part of the expression for the name in two separate places, once in the variable expression for the file name and once in the actual final file name (including folder path) . So at each loop, each place was adding to the final name. Don't know if that's what happened here but it sounds similar.
Post #1422639
Debbie Edwards
Debbie Edwards
Posted Thursday, February 21, 2013 8:43 AM
SSC-Addicted
Group: General Forum Members
Last Login: Wednesday, May 22, 2013 4:50 AM
Points: 423,
Visits: 633
Heres a thought.....
In the Flat file connection managers properties I have
ConnectionString set to \\D-fs07\spar-it\PROJECTS\1 Active Projects\DATA WAREHOUSING PROJECT\Development\Extract_To_CSV\Test.csv
And Expressions Connection String set to @[Extract_To_CSV_Folder]+@[User::DFES_NAME_DATE_File_Name]+".csv"
The fact there are 2 connection strings is very confusing. Could this be why its going wrong?
Post #1422640
Debbie Edwards
Debbie Edwards
Posted Thursday, February 21, 2013 8:45 AM
SSC-Addicted
Group: General Forum Members
Last Login: Wednesday, May 22, 2013 4:50 AM
Points: 423,
Visits: 633
your right! I think Im going to have to reask for a bigger screen, I dont think my eye sight is doing me any favours. Ill have another go at that one
Post #1422645
kl25
kl25
Posted Thursday, February 21, 2013 8:48 AM
SSC Veteran
Group: General Forum Members
Last Login: Yesterday @ 2:10 PM
Points: 262,
Visits: 1,167
Debbie Edwards (2/21/2013)
Heres a thought.....
In the Flat file connection managers properties I have
ConnectionString set to \\D-fs07\spar-it\PROJECTS\1 Active Projects\DATA WAREHOUSING PROJECT\Development\Extract_To_CSV\Test.csv
And Expressions Connection String set to @[Extract_To_CSV_Folder]+@[User::DFES_NAME_DATE_File_Name]+".csv"
The fact there are 2 connection strings is very confusing. Could this be why its going wrong?
Probably not the issue here. The expression would replace the hard coded connection manager when the process runs.
Post #1422647
Debbie Edwards
Debbie Edwards
Posted Thursday, February 21, 2013 8:49 AM
SSC-Addicted
Group: General Forum Members
Last Login: Wednesday, May 22, 2013 4:50 AM
Points: 423,
Visits: 633
Debbie Edwards (2/21/2013)
your right! I think Im going to have to reask for a bigger screen, I dont think my eye sight is doing me any favours. Ill have another go at that one
Nope Id already sorted that one out the last time I had ago and Im still getting the same error about the [Square symbol] not being recognised.
And adding the folder as a variable is doing even crazier things.
And I dont understand Why I have in properties ConnectionString and Expressions - ConnectionString.
Post #1422648
Debbie Edwards
Debbie Edwards
Posted Thursday, February 21, 2013 8:52 AM
SSC-Addicted
Group: General Forum Members
Last Login: Wednesday, May 22, 2013 4:50 AM
Points: 423,
Visits: 633
kl25 (2/21/2013)
Debbie Edwards (2/21/2013)
Heres a thought.....
In the Flat file connection managers properties I have
ConnectionString set to \\D-fs07\spar-it\PROJECTS\1 Active Projects\DATA WAREHOUSING PROJECT\Development\Extract_To_CSV\Test.csv
And Expressions Connection String set to @[Extract_To_CSV_Folder]+@[User::DFES_NAME_DATE_File_Name]+".csv"
The fact there are 2 connection strings is very confusing. Could this be why its going wrong?
Probably not the issue here. The expression would replace the hard coded connection manager when the process runs.
Ah, so its definitely using the ConnectionString one. Im totally lost now as to how Im going to get the folder name in there, Unless I change all my folders to be in the C drive, without spaces in the Names, but I feel like that would be the wrong way to go, you should be able to have your folders any where, not just the C Drive
Post #1422650
kl25
kl25
Posted Thursday, February 21, 2013 9:00 AM
SSC Veteran
Group: General Forum Members
Last Login: Yesterday @ 2:10 PM
Points: 262,
Visits: 1,167
Here's the general approach I use:
1. Set a variable for the path (folder). Learned early on to separate the path because paths that I thought would NEVER change did.
2. Set a variable for the file name. This is often an expression to allow including the run date or other important but changing aspects of the file name.
3. Set a variable for the full file name. This is always an expression of @Path + @FileName.
4. Set the expression for the connection string to @FileNameFull for the flat file connection manager via the properties window, expressions section.
I think that's what you're doing but I'm not positive.
Post #1422653
« Prev Topic
|
Next Topic »
13 posts, Page 1 of 2
1
2
»»
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.