The HasServer property reports the presence of a target server for a job.
object.HasServer
Part | Description |
---|---|
object | Expression that evaluates to an object in the Applies To list |
If True, the ApplyToTargetServer or ApplyToTargetServerGroup methods have completed successfully and the job may be available for execution.
If False, the job does not have an execution target set.
SQL Server Agent jobs must have at least one job step and must be targeted to a server to be executable.
For stand-alone or multiserver administration target servers, the job can be targeted only to the local server. For a multiserver administration master server, the targeted server can be itself or any server enlisted as a multiserver target.
The ApplyToTargetServer and ApplyToTargetServerGroup methods set the target server of a job.
Boolean
Read-only
HRESULT GetHasServer(LPBOOL pRetVal);
ApplyToTargetServer Method | ApplyToTargetServerGroup Method |