9

I want to know if any tools exist to explore the data in a relational database, and to drill through master-detail relationships.

I already know how to view the data in a single table, and I know how to construct SQL queries that JOIN tables. However, to get N-levels deep, I have to write a SQL statement, find the ID of the item I'm interested in, and repeat N times. It is extremely tedious and hard to visualize the results.

However, I want to know if there is a tool that lets me look at the data in a table, and if there are foreign keys, lets me expand the data to show the foreign data. And hopefully, lets me drill through multiple levels of detail.

Do any such tools exist?

I'm using MS SQL, and using SQL Server Management Studio to execute SQL.

1

2 Answers 2

3

Information regarding keys and table information could be accessed through the sysobjects and other sys tables and I have seen some custom scripting that is capable of reading these tables to provide some of the info you're looking for here, though click drill down functionality is well out of that scope. I think TOAD (Tool for oracle app developers) might have some options along this route (though probably not in the free version).

It almost sounds like you're looking for a dashboard setup that will visualize and allow you to click and drill down through results. I'm unsure on free software for this functionality, though tools such as business objects, microstrategy, and several others will give you what (i think) you're looking for. Possibly expensive and could take quite a bit of time to implement pending your setup...tis what I get paid to do ;)

Just to echo Beth, you can create diagrams withins MSSQL...it'll give you and idea of how the tables relate, assuming proper keys and relations have been setup.

Editting to add: another comment towards this part of your questions : I already know how to view the data in a single table, and I know how to construct SQL queries that JOIN tables. However, to get N-levels deep, I have to write a SQL statement, find the ID of the item I'm interested in, and repeat N times. It is extremely tedious and hard to visualize the results.

I'll nest my queries (this is a troubleshooting technique only, don't you dare try to implement something like this for production)...

 select * from finaltable where ID in 
    (select id2 for table2 where anotheridcolumn in 
    (select id3 from yetanothertable where yet anotheridcolumn in (input_id_you're_looking_for)

I really wouldn't use this technique if you expect more than 5 or 10 rows returned at the end...but it'll save some of the tedious run one statement and copy result into next work you're doing

5
  • Thanks for your suggestions! I looked into TOAD for MS SQL, and the paid version has a feature called "Master-Details Browser" which is close to what I am looking for. The only limitation is that it requires you to create a diagram of your tables and relations, before letting you see the data. I wish I could just join to any table, on-the-fly, as I explore data. Oct 8, 2010 at 22:25
  • Any of the tools listed will require the same. There's just too many ways of setting up a database to achieve any given result for a program to put together like these on the fly. A database is just a structure and data in it, the logic of how this data is used goes beyond that. There's so many methods of doing the same thing...a value you're looking for could even be calculated and not directly stored. I've seen a telco database store circuits all in one tables, all having 5 layers...meaning the table was joined to itself 5 times to create a circuit. No program can pick out this logic
    – Twelfth
    Oct 11, 2010 at 17:05
  • Incidentally, if there is a program that does this, please don't post it...I think I'd be out of a job ;)
    – Twelfth
    Oct 11, 2010 at 17:06
  • Well, I realize that a program couldn't automatically make all the connections, but I guess I'm imagining a program that lets me "guide" it to make connections. Something with a GUI to visualize the data. Oct 26, 2010 at 20:35
  • 1
    TOAD is by far the closest I've come to an answer. Even the free version helps, with its intellisense that can automatically join a table based on foreign key constraints. It's saved me tons of typing! Oct 26, 2010 at 20:40
2

Would creating a diagram help? Or using the visual part of a view?

1
  • A diagram is almost EXACTLY what I want -- but a diagram just shows the schema. I want a diagram that shows the data! Oct 8, 2010 at 22:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.