Refresh Method (SQL-DMO)

The Refresh method updates a SQL-DMO object or collection with current values from the referenced Microsoft® SQL Server™ installation.

Applies To
Alert Object Logins Collection
AlertCategories Collection MergeSubsetFilters Collection
Alerts Collection MergeArticles Collection
AlertSystem Object MergePublications Collection
BackupDevices Collection MergePullSubscriptions Collection
Category Object MergeSubscriptions Collection
Checks Collection NameList Object
Columns Collection Names Collection
ConfigValues Collection Operator Object
DatabaseRoles Collection Operators Collection
Databases Collection OperatorCategories Collection
DBFiles Collection QueryResults Object
DBOption Object RegisteredSubscribers Collection
Defaults Collection RegisteredServers Collection
DistributionArticles Collection RegisteredSubscriber Object
DistributionDatabase Object RemoteServers Collection
DistributionDatabases Collection RemoteLogins Collection
DistributionPublications Collection ReplicationDatabases Collection
DistributionPublisher Object Rules Collection
DistributionPublishers Collection Schedule Object
DistributionSubscriptions Collection ServerGroups Collection
Distributor Object ServerRoles Collection
FileGroups Collection SQLObjectList Object
FullTextCatalogs Collection StoredProcedures Collection
Indexes Collection Table Object
IntegratedSecurity Object Tables Collection
Job Object TargetServer Object
JobCategories Collection TargetServerGroup Object
Jobs Collection TargetServerGroups Collection
JobSchedule Object TargetServers Collection
JobSchedules Collection TransArticles Collection
JobServer Object TransPublications Collection
JobStep Object TransPullSubscriptions Collection
JobSteps Collection TransSubscriptions Collection
Keys Collection Triggers Collection
Languages Collection UserDefinedDatatypes Collection
LinkedServerLogins Collection Users Collection
LinkedServers Collection Views Collection
LogFiles Collection  

Syntax

object.Refresh( [ Release ] )

Part Description
object Expression that evaluates to an object in the Applies To list
Release True or False as described in Settings

Settings

When Release is True, all references maintained on a collection member, and any collections or objects within the member’s tree, are released by force by SQL-DMO. SQL-DMO objects used by the application are invalid. SQL-DMO retrieves member object property values and refreshes the member object collection on the next application access to the object.

When Release is False (default), application-maintained references are released only when the reference is on an object exposing a deleted or removed SQL Server component. Accessing a member object does not refresh member property values or contained collections.

Remarks

Use caution when using the Refresh method. In general, it is best to override the default value for the Release argument, as forcing reference release ensures that all objects within a hierarchy represent the current state of a SQL Server installation.

Limit the scope of the Refresh method to optimize its execution. For example, use the Refresh method of a Table object to update the application image of properties of a specific SQL Server table when applicable, rather than using the Refresh method of Tables collection indiscriminately.

Prototype (C/C++)

HRESULT Refresh(BOOL bReleaseMemberObjects = FALSE);

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.