CreateAgentProfile Method (SQL-DMO)

The CreateAgentProfile method creates a replication agent profile.

Applies To

Distributor Object

Syntax

object.CreateAgentProfile( bstrName , bstrDescription , ReplAgentType )
as Long

Part Description
object Expression that evaluates to an object in the Applies To list
bstrName String specifying profile name
bstrDescription String containing descriptive text
ReplAgentType Long integer specifying a replication agent type as described in Settings

Settings

Set the ReplAgentType argument by using these values.

Constant Value Description
SQLDMOReplAgent_Distribution 3 Replication Distribution Agent
SQLDMOReplAgent_LogReader 2 Replication transaction log monitoring agent
SQLDMOReplAgent_Merge 4 Replication Merge Agent
SQLDMOReplAgent_Snapshot 1 Replication Snapshot Agent

Returns

A system-generated, long integer identifying the agent profile.

Remarks

Use the CreateAgentProfile method to add a replication agent profile to a Distributor. The new profile is a copy of the default profile in use for the agent.

Use the ChangeAgentParameter method to modify parameter values and change the behaviors configured by the newly created profile.

Prototype (C/C++)

HRESULT CreateAgentProfile(SQLDMO_LPCSTR szName,
SQLDMO_LPCSTR szDescription,
SQLDMO_REPLAGENT_TYPE AgentType, long *plProfileID);


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