dynamic changing connection string to retrieve .sql files

  • Hi everyone...

    I have a scenario like this,i have a dll file and i call that file to my package through scriptask and that dll file is creating one .sql file.Now i want to bring that file and needs to execute,each time running the package the dll file is creating one .sql file and it is saving with latest modified date,ihave to bring the latest .sql file and needs to execute.Can any one help me on this....

    Regards..
    guru12

  • Hi everyone..

    Can anyone please give reply,its very urgent.

    Regards..
    guru12

  • Hi Everyone..

    nobody are there to give reply for my question,its very urgent ,i would be thnkful to you,please give reply.

    Regards..
    guru12

  • guru12 (8/5/2010)


    Hi Everyone..

    nobody are there to give reply for my question,its very urgent ,i would be thnkful to you,please give reply.

    Does the dll file returns the file name as output value? In that case you can store that in a variable together with the folder path. You can create a new file connection pointing to this variable. Then you can use "execute sql" task with File connection for sql source property.

    [font="Arial"]BASKAR BV
    http://geekswithblogs.net/baskibv/Default.aspx
    In life, as in football, you won’t go far unless you know where the goalposts are.[/font]

  • Hi Baskar..

    Thankyou for giving reply,from yesterday onwards i am waiting,i will try this and let you know the result.

    Regards..
    guru12

  • Please explain what you mean by

    and it is saving with latest modified date

    ?

    Do you mean that there are multiple files in a folder and you want to execute the one with the latest date as part of the file name? Can you give an example of the naming convention?

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • Hi Phil..

    my file is saving like this,

    D:\sync_scripts\SyncScript20100806111820.sql this is file path

    Regards..
    guru12

  • Can you change your process slightly as follows:

    1) Move all files from D:\sync_scripts to an archive folder somewhere

    2) Run the DLL

    3) Use a FOREACH loop to execute all files in D:\sync_scripts (there should be only one, right?)

    Then you don't need to worry about the file name.

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • Hi Phil..

    I will try both and let you know the status,any way thanks for giving reply.

    Regards..
    guru12

  • Hi Baskar..

    I did like this ,created a file connection and for that connection string in expression i aasigned the variable wchich returns the full file path on fly,in execute sql task i have taken file connection and which i have created and and i run the task,i executes successful ,and it is bringing on fly path.thanks for your solution it helped me lot,

    Regards..
    guru12

  • No problem. You are welcome.

    [font="Arial"]BASKAR BV
    http://geekswithblogs.net/baskibv/Default.aspx
    In life, as in football, you won’t go far unless you know where the goalposts are.[/font]

Viewing 11 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic. Login to reply