Couple of days back, I was trying to get the table dependencies in SQL Server 2005, but I faced a weird "bug", I would say, that prevented me from seeing "All" the dependent tables on that specific table. I thought that "View Dependencies" in the SQL Server would find all the tables referencing the one I have selected, check its foreign keys and so, it can list the dependent tables but for some reason, some tables were not retrieved !!! I checked the differences between both tables referencing the parent table and found no differences at all !!!
After searching for this weird issue online, I found this totally "other" way for finding what I wanted which was listed in this website. I tried it and it worked :))
That was the SQL snippet that worked for me :))
-- Value 131527 shows objects that are dependent on the specified object
EXEC sp_MSdependencies N'HumanResources.[Employee]', null, 1315327
-- Value 1053183 shows objects that the specified object is dependent on
EXEC sp_MSdependencies N'HumanResources.[Employee]', null, 1053183
Of course, these numbers, passed as parameters to the procedure, mean something BIGGGG, but who cares for the moment... it's working NOW :)))
Enjoy SQLing :)
No comments:
Post a Comment