Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
svicky9
Posting Yak Master
232 Posts |
Posted - 2006-09-05 : 13:52:13
|
Hi FriendsI am trying to find a query for all the objects and their dependencies using the system tables sysdepends and sysobjects I got till this queryselect so.name as [Object Name], so1.name as [Depended Object] from sysobjects so join sysdepends sd onso.id = sd.id join sysobjects so1on so1.id = sd.depidI want to make it a pivot table likeObject name DependenciesObj1 Dep1,Dep2,Dep3Obj2 Dep1,Dep2,Dep3..and so onSo how do i pivot this tableor is there anyway that the query can look better?Vic |
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2006-09-05 : 13:56:55
|
Before you go down that road, are you aware that sysdepends may not have all dependent objects? For instance cross database dependencies won't be in there. Also, I believe sql will allow you to compile an SP that uses a function that hasn't been compiled yet. So if you create your objects "out of order" you could end up with a missing sysdepends rows.Be One with the OptimizerTGEDIT:however, here are some references to pivoting data:http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=55210&SearchTerms=pivot |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-09-05 : 20:58:52
|
Also read about Cross-tab Reports in sql server help fileMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|