GetJobByID Method (SQL-DMO)

The GetJobByID method returns a SQL-DMO Job object referencing the SQL Server Agent job identified by the specified job identifier.

Applies To

JobServer Object

Syntax

object.GetJobByID( Name , [ Flag ] ) as Job

Part Description
object Expression that evaluates to an object in the Applies To list.
Name String representation of a SQL Server Agent job identifier.
Flag When True, the GetJobByID method queries the Microsoft® SQL Server™ installation for the most recent copy of the job. When False (default) and the application has cached the define jobs in a collection, only the cached collection is searched.

Returns

A Job object.

Remarks

SQL Server Agent jobs are uniquely identified by a system-generated identifier. The identifier is a 32-character string representing a hexadecimal number and is visible in the JobID property of a SQL-DMO Job object.

Prototype (C/C++)

HRESULT GetJobByID(
SQLDMO_LPCSTR szName,
LPSQLDMOJOB* ppJob,
BOOL bFlag = FALSE);

  


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