Import

  • I have 5 DB's A,B,C,D,E and importing data from these 5 into a test DB. before importing into test I also want to determine which DB I am importing and save DBName,Email(1 email for each DB) for each database respectively. all this will be done through a sql job. The job will import data from each DB into test DB.

    1) where can i have a predefined table with DBName,EMail as fields in it. either in each 5 DB's or just in test DB.

    2) How can I import the data from this pre defined table for each DB(A,B,C,D,E) import respectively.

  • I'm not sure what you mean here. Import into test before test?

    If you are trying to drive a job with a loop, I'd make a table in some db, maybe your test 1 db and populate it with the information. Then read this table, use the database name to dynamically alter the import database in the connection or just call a specific import.

  • Start from here:

    I have 5 DB's A,B,C,D,E and importing data from these 5 into a test DB.

    Where have you got this piece of information stored?

    _____________
    Code for TallyGenerator

  • I have 5 Db's and the test DB on the server.

  • I guess that means they're on the same server... so...

    1) where can i have a predefined table with DBName,EMail as fields in it. either in each 5 DB's or just in test DB.

    The common spot... the test DB.

    2) How can I import the data from this pre defined table for each DB(A,B,C,D,E) import respectively.

    INSERT/SELECT using 3 part naming convention.

    Could also build a nice little view in test DB to accumulate the data for an INSERT.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Mike Levan (11/9/2007)


    I have 5 Db's and the test DB on the server.

    You have at least 6 DB's:

    master, tempdb, model, msdb, pubs, probably Northwind, and you "test DB" is 6th or 7th.

    If these are the databases you want to import data to then I know where they are listed - in master.dbo.sysdatabases.

    _____________
    Code for TallyGenerator

Viewing 6 posts - 1 through 5 (of 5 total)

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