Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Multple SQL Databases with same Table Names -- Crystal Reports

Posted on 2009-05-12
2
Medium Priority
?
198 Views
Last Modified: 2012-05-06
I am using Crystal Reports to access data in a SQL Express 2008 instance, but my question is more a general SQL quesiton than a Crystal Reports question.

I am presently using "AccessBooks RealTime" to export the data from about 10 QuickBooks files into SQL. "AccessBooks RealTime" does not support importing multiple QuickBooks files into one database, since List ID's are not unique across QuickBooks files.

Presently, I have a database for each QuickBooks file, and the sync is working fine between the QB files, and their respective databases.

What I want to be able to do, is show certain pieces of information from each database, alongside one another. For example, there is an "Accounts" table, which has two fields, "AccountType", and "AccountBalance". I would like to be able to pull this data from databases A, B, and C. Of course, the table name, and the field name is identical on all three databases.

I somehow need to "flag" which database each piece of data is coming from. In the above example, I might want to display Cash Balance by Company. Then I would want to filter where AccountType == Cash, and then show the balance for Company A, Company B, and Company C, all together.

Hopefully that makes sense. Any ideas on how to achieve something like that? Is there any way I could create a view that aggregates all of my various databases into one, with a new field or prefix that specifies what database it is coming from?

I have also looked at qODBC to export QB data to SQL, which appears to be more flexibile, but I would have to write the update statements to migrate the data to SQL manually. Of course, then I could probably add my own prefixes to each table as it is updated, but that seems like a lot of work.
0
Comment
Question by:netmergence
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 6

Accepted Solution

by:
BALMUKUND KESHAV earned 2000 total points
ID: 24371579
Use Database.Tablename in select statement if you are using same tablename from more than one database, use database1.tablename1.AccountType as accounttypeA or database2.tablename2.AccountType as accounttypeB something like that .
or
Make different views for different databases and use filedname as asyoulikefieldname in views and finally use the different views to make a final sql/views.

Bm Keshav

0
 

Author Closing Comment

by:netmergence
ID: 31580841
I knew there would be an easy solution. "select as" fits the bill perfectly. Thanks!
0

Featured Post

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Lotus Notes has been used since a very long time as an e-mail client and is very popular because of it's unmatched security. In this article we are going to learn about  RRV Bucket corruption and understand various methods to Fix "RRV Bucket Corrupt…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question