Freigeben über


RemoveJobsByLogin Method

Diese Funktion wird in zukünftigen Versionen von Microsoft SQL Server nicht mehr bereitgestellt. Verwenden Sie diese Funktion beim Entwickeln neuer Anwendungen nicht, und planen Sie das Ändern von Anwendungen, in denen es zurzeit verwendet wird.

The RemoveJobsByLogin method drops all SQL Server Agent jobs owned by the login identified and removes the referencing Job objects from the Jobs collection.

Syntax

object.RemoveJobsByLogin(Login)

Parts

  • object
    Expression that evaluates to an object in the Applies To list.

  • Login
    String that identifies a Microsoft SQL Server login by name.

Prototype (C/C++)

HRESULT RemoveJobsByLogin(
SQLDMO_LPCSTR szLogin);

Hinweise

By default, any SQL Server login has membership, through the user guest, in the public role of the system database maintaining SQL Server Agent jobs (msdb). When a SQL Server user is created in msdb, jobs created by the user mapping the login are owned by the login, not the user.

HinweisHinweis

Removing SQL Server Agent jobs by using the RemoveJobsByLogin method requires appropriate privilege. The SQL Server login used for SQLServer object connection must be the login indicated in the Login argument and having a job ownership privilege or a member of a role with greater permission.

Applies To: