Local Trees

SMO, unlike SQL-DMO, does not have a global object tree with an Application object as its root. Instead, SMO enables users to create multiple object trees called Local Trees using the Server object as root. After each tree is populated, it represents a snapshot of the Database Engine metadata at the time the tree population took place. Local trees are not synchronized with each other. In other words, changes made to any Database Engine object represented in the tree, including the changes made through another tree of the object model itself, are not propagated to other instances of the same object in other trees. At any point in time any local tree can be released and objects in collections can be emptied, as shown in Figure 11-5.

Figure 11-5. SMO local trees with releasable state vs. SQL-DMO global tree.


If you believe the object to which you are holding a reference is stale and want to refresh its internal properties before making further modifications or discarding previous ones, you can accomplish this by directly calling the Refresh method on the object.

Inside SQL Server 2005 Tools
Inside SQL Server 2005 Tools
ISBN: 0321397967
EAN: 2147483647
Year: 2006
Pages: 149

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net