how to read database name from a excel file in to a package

  • Hello,

    I need to find out how can I read the database name from a excel file instead of writing in in T -sql.

    I am writing a tsql job, could be a ssis package too and in that the job needs to read the database it has to run against from a excel file instead me writing it in the code??

    Any help in this matter is appreciated.

  • Why are you storing the database name in an Excel file?

    What is your set-up? What are your requirements?

    What are you trying to accomplish?

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • well we have a database mirroring disabale job that we run on demand..and since we have 25 databases we have 25 different jobs for each database.

    i want to have a ssis package that reads the name of the databases from a file and than just run the job and disable mirroring.

  • qur7 (1/7/2011)


    well we have a database mirroring disabale job that we run on demand..and since we have 25 databases we have 25 different jobs for each database.

    i want to have a ssis package that reads the name of the databases from a file and than just run the job and disable mirroring.

    Wouldn't it be easier if you stored the names of the databases in a table. You can read it with a simple SQL statement, store the results in a resultset. With a for each loop you can loop over this resultset and execute the necessary statement for each database.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

Viewing 4 posts - 1 through 4 (of 4 total)

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