Helpful Macros

SQL-DMO

SQL-DMO

Helpful Macros

These macros, assisting the C/C++ developer, are defined within Sqldmo.h.

SQLDMOCategory_UseDefault

For the Category property of the Alert, Job, and Operator object, SQL-DMO defines the macro SQLDMOCategory_UseDefault as TEXT("[DEFAULT]"). Use the macro when setting the property, as in:

pAlert->SetCategory(SQLDMOCategory_UseDefault);
SQLDMOTargetServer_Local

For the ApplyToTargetServer and RemoveFromTargetServer methods of the Job object, SQL-DMO defines the macro SQLDMOTargetServer_Local as TEXT("(local)"). Use the macro when altering job execution target, as in:

pJob->ApplyToTargetServer(SQLDMOTargetServer_Local);
SQLDMOAlert_NoJob

For the JobID property of the Alert object, SQL-DMO defines the macro SQLDMOAlert_NoJob as TEXT("00000000000000000000000000000000"). Use the macro to test or change the value of the property.

SQLDMO_ECAT_MASK

SQL-DMO errors enumerated by the SQLDMO_ERROR_TYPE data type are defined as groups of related errors.

SQL-DMO defines the macro SQLDMO_ECAT_MASK as 0x5F00. Use the macro to mask an error returned by SQL-DMO, as in:

// Handle insufficient privilege error.
if (SQLDMO_ECAT_UNPRIVILEGEDLOGIN == (hr & SQLDMO_ECAT_MASK))
{
// Execeptional processing for attempt to perform modification.
}