Controls the registration of an instance of Microsoft SQL Server in the Microsoft Windows Active Directory. The actions of sp_ActiveDirectory_SCP always apply to the connected instance of SQL Server.
After registering an instance of SQL Server in the Active Directory, you can use sp_ActiveDirectory_Obj to register any of the databases in the instance, and you can use sp_addpublication or sp_addmergepublication to register publications.
Active Directory registration can only be modified by the account that created it. When you change the security account used by the SQL Server service, delete the Active Directory registration, change the service account, and then create the Active Directory registration again.
The following example registers the current instance of SQL Server in the Active Directory.
DECLARE @RetCode INT EXEC @RetCode = sp_ActiveDirectory_SCP @Action = N'create' PRINT 'Return code = ' + CAST(@RetCode AS VARCHAR)