Unhandled exception visiting not scheme-associated dependencies

Feb 15, 2014 at 9:38 AM
To whomever it may interest: in Sql Server 2008R2, this application (very useful, by the way) crashed, due to unhandled exception, when visiting the dependencies for some stored procedures. I investigated and I found out that those stored procedures used table-valued variables or input XML parameters.
In the latter case, indeed, SSMS shows a dependency of type not scheme-associated, to an unresolved entity.
I was able to cure this problem by wrapping, in the ScriptDependencyTreeNode method, the lines
sortUnit.namedSmoObject = (NamedSmoObject)server.GetSmoObject(dependencyTreeNodeChild.Urn);
Children.Add(sortUnit);
with a
try {...put those two lines here...} catch { }
Maybe a bit brutal but it worked.
Aug 5, 2015 at 2:00 PM