Refresh Method

This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature.

The Refresh method updates a SQL Distributed Management Objects (SQL-DMO) object or collection with current values from the referenced instance of Microsoft SQL Server.

Syntax

object.Refresh( [ Release ] )

Parts

  • object
    Expression that evaluates to an object in the Applies To list.

  • Release
    TRUE or FALSE as described in Settings.

Prototype (C/C++)

HRESULT Refresh(BOOL bReleaseMemberObjects = FALSE);

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 an instance of SQL Server.

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.

Applies To:

Alert Object

Logins Collection

AlertCategories Collection

MergeSubsetFilters Collection

Alerts Collection

MergeArticles Collection

AlertSystem Object

MergeDynamicSnapshotJobs Collection

BackupDevices Collection

MergePublications Collection

Category Object

MergePullSubscriptions Collection

Checks Collection

MergeSubscriptions Collection

Columns Collection

NameList Object

ConfigValues Collection

Names Collection

DatabaseRoles Collection

Operator Object

Databases Collection

Operators Collection

DBFiles Collection

OperatorCategories Collection

DBOption Object

QueryResults Object

Defaults Collection

RegisteredSubscribers Collection

DistributionArticles Collection

RegisteredServers Collection

DistributionDatabase Object

RegisteredSubscriber Object

DistributionDatabases Collection

RemoteServers Collection

DistributionPublications Collection

RemoteLogins Collection

DistributionPublisher Object

ReplicationDatabases Collection

DistributionPublishers Collection

ReplicationStoredProcedures Collection

DistributionSubscriptions Collection

ReplicationTables Collection

Distributor Object

Rules Collection

FileGroups Collection

Schedule Object

FullTextCatalogs Collection

ServerGroups Collection

Indexes Collection

ServerRoles Collection

IntegratedSecurity Object

SQLObjectList Object

Job Object

StoredProcedures Collection

JobCategories Collection

Table Object

Jobs Collection

Tables Collection

JobSchedule Object

TargetServer Object

JobSchedules Collection

TargetServerGroup Object

JobServer Object

TargetServerGroups Collection

JobStep Object

TargetServers Collection

JobSteps Collection

TransArticles Collection

Keys Collection

TransPublications Collection

Languages Collection

TransPullSubscriptions Collection

LinkedServer2 Object

TransSubscriptions Collection

LinkedServerLogins Collection

Triggers Collection

LinkedServers Collection

UserDefinedDatatypes Collection

LogFiles Collection

Users Collection

 

Views Collection