Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2006

    Unanswered: SSIS-problems making a dynamic flat file connection string


    I have packages that must generate log errors dynamically including time of execution and the name of the task.

    I make it changing the properties of the connection inserting two expressions.

    1.-I alter the File Usage Type to 1 to generate this files.
    2.- I alter the connection string as: @[User::myvariable] +"constant_description"+ time description+ +".txt"

    The time description is :
    (DT_STR,40,1252) DAY (GETDATE())+"-"+(DT_STR,40,1252) MONTH( GETDATE())+"-"+(DT_STR,40,1252) YEAR( GETDATE())+" + REPLACE( (DT_STR,10,1252) (DT_DBTIME) GETDATE(),":","_")
    But it is not the problem

    In those packages I have one connector for all the tasks and in execution time it creates one file for each of the tasks.

    The problem is the way I insert in the filename the task name.

    I have a pre-execute event handler in each task that modifies a string variable( myvariable) appending the task name. When I execute de package it works great but when I only execute a task, the program do not enter in the event and do not put the task’s name.

    How can I put that name without using that handler? There is another handler can I use to do it that happens before the system generates the new file name and after pre-execute? Anyone knows another way to do this kind of things?

  2. #2
    Join Date
    Dec 2006
    Nobody has any idea?

  3. #3
    Join Date
    Jun 2003
    Provided Answers: 1
    Let me get this straight...
    A package handles multiple files by looping through a task that handles a single file at a time.
    The variable to define the errors exist in the package, so that when you run an individual task it is not properly logging to the file

    I'd suggest, in the task, using default variable values if the parameters from the package are nulls.
    If it's not practically useful, then it's practically useless.

    blindman "sqlblindman"

  4. #4
    Join Date
    Nov 2002
    I suggest that you stop using SSIS

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts