Метод JobServer.ReassignJobsByLogin
Changes ownership for any SQL Server Agent job currently owned by a SQL Server login.
Пространство имен: Microsoft.SqlServer.Management.Smo.Agent
Сборка: Microsoft.SqlServer.Smo (в Microsoft.SqlServer.Smo.dll)
Синтаксис
'Декларация
Public Sub ReassignJobsByLogin ( _
oldLogin As String, _
newLogin As String _
)
'Применение
Dim instance As JobServer
Dim oldLogin As String
Dim newLogin As String
instance.ReassignJobsByLogin(oldLogin, _
newLogin)
public void ReassignJobsByLogin(
string oldLogin,
string newLogin
)
public:
void ReassignJobsByLogin(
String^ oldLogin,
String^ newLogin
)
member ReassignJobsByLogin :
oldLogin:string *
newLogin:string -> unit
public function ReassignJobsByLogin(
oldLogin : String,
newLogin : String
)
Параметры
- oldLogin
Тип: System.String
A String value that specifies the old SQL Server login.
- newLogin
Тип: System.String
A String value that specifies the new SQL Server login.
Замечания
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.
Reassigning SQL Server Agent job ownership by using the ReassignJobsByLogin method requires appropriate permission. The SQL Server login used for the current connection must be a member of the fixed role sysadmin.
Примеры
Планирование автоматических административных задач в агенте SQL Server
См. также
Справочник
Пространство имен Microsoft.SqlServer.Management.Smo.Agent
Другие ресурсы
Задачи автоматизированного администрирования (агент SQL Server)