November 8, 2007 at 9:25 am
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.
November 8, 2007 at 9:47 am
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.
November 8, 2007 at 5:14 pm
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
November 9, 2007 at 5:51 am
I have 5 Db's and the test DB on the server.
November 9, 2007 at 7:54 am
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
Change is inevitable... Change for the better is not.
November 9, 2007 at 2:37 pm
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