Wednesday, March 7, 2012

i need to create a report by using 5 databases

let me put it little more deatail,
i'm using crystal report XI,
I have 5 database servers and i need to make a report on the table which is common among all 5 DB's.
sample.
employ,
empnum, empname,.......
pls some one help me out hereIf all databases exist on the same server, then you can reference the tables directly and do joins on them like this:

select ....
from DB1.dbo.Table1 AS d1t1
inner join DB2.dbo.Table2 as d2t1 ON d1t1.ID = d2t1.ID
...

What you need to do is create a view, to be used as a table for Crystal Reports. Then when you "select * from" the view, it will query each of the databases as defined in the view.

If the databases exist on a different server, u should consult your administrator about setting up a link. Not all database systems support linked databases. When you query a table from a linked database, expect it to be very very slow, since it has to copy the tabledata across the network before the join can begin.. so depending on the query, u may end up copying the whole table from each database, as temporary data, every time the report executes.

To speed this up, you could replicate the necessary data into the report database, either with some kind of replicator or by scheduling a daily process to get the new data to be used. Then its a local table you are querying or joining against.

Does this answer your question?

No comments:

Post a Comment