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 2012 Forums
 SSIS and Import/Export (2012)
 Text File Logging: Connection mgr filepath variabl

Author  Topic 

ipisors
Starting Member

39 Posts

Posted - 2015-03-23 : 18:02:33
I am setting up text file logging for my SSIS package. Typically I have custom coded these type of things, because I like to decide when and what exactly gets written to the line of a text file. But I'm succumbing mostly to laziness and partly to peer pressure to give SSIS a chance and see how the "built-in" function works.

For the text file connection manager, I specified usagetype='createfile' and I initially put in the desired path, along with a backslash and some dummy file (to start with).

What I really want, is a new file to be created in the folder I specified, with the filename like mmddyyhhmmss.txt

Now true to best practices and my own principals of development, I try to keep coding in as few places as possible - for example, I don't use expressions directly in property windows or variable defaults. I use SCRIPT TASKS to set them, so that it is easy to find and everything is in one place - VB.NET. However , as I started to code a script task to set the value of my new string variable "logfilepath" (which is going to be the variable for the text file manager's connection string), I realized something...Won't this LOGGING feature need to know its own path information , like, IMMEDIATELY? Prior to any task (including my script task) executing?

Is there any solution for this and still do it 'my way' (where the assignment of the file path variable happens in an initial Script Task in the package), if not.. then...I hate to do this, but, please help me write the "ssis special syntax" code required to put an expression directly in the properties window of the connection manager.
I understand it will be some kind of hybrid syntax of SQL and "SSIS". Kind of like Crystal syntax/yuck which is why I don't do it.

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2015-03-24 : 08:50:51
"I don't use expressions directly in property windows or variable defaults. I use SCRIPT TASKS to set them"

warning bells going off in my head! This sounds like an extremely bad idea. In general, expressions are much easier for experienced SSIS developers to work with.
Go to Top of Page
   

- Advertisement -