Forum Discussion

NarreN's avatar
NarreN
Frequent Visitor
6 years ago

Need tips for report with a tricky database

Hi!

I need to make a report from a database in our Azure enviroment. The report should allow us to search for our customers, then display a table with all the error messages we have logged on this customer. I have made reports like this before, but the database is structured in a way im not quite sure how to achieve this.

 

dbo.companyTable

IDConnectionGUIDName
1c8b3e90d-f72b-4dd4-ac4f-40551eec6ad8AAA
271359f20-99d9-4ecd-a043-a001efb8bee9BBB
3c0cd916b-d4d7-41c3-9702-5a24ea8eaaaeCCC

 

Then we have one table for each customer which is called.

dbo.ErrorHandling_c8b3e90d_f72b_4dd4_ac4f_40551eec6ad8

dbo.ErrorHandling_71359f20_99d9_4ecd_a043_a001efb8bee9

dbo.ErrorHandling_c0cd916b_d4d7_41c3_9702_5a24ea8eaaae

 

Notice how the ConnectionGUID (Unique key for each customer) is seperated with a hyphen in dbo.companyTable and with an underscore in the ErrorHandling table. I guess I could use a replace to generate the correct connectionGUID. But how would I approach the table showing the data. It would need to change where the table is getting is data based on which customer I search for.

 

Any tips on how to apporach this? We get new customers also, so I want the report to be as dynamic as possible if we get a new customer.

 

Thanks!

1 Reply

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    Well, and this is my opinion. If it were me, I would see what I could do to union all of the customer tables together with a column for their customer GUID. Then everything is easy.