2010. 11. 22. 22:30
Brain Trainning/DataBase
declare
@jobName nvarchar(255)
declare
curJobs cursor fast_forward
for
select name from dbo.sysjobs where
owner_sid = suser_sid('old_account', 0) order by name
open curJobs
fetch next from curJobs
into @jobName
while @@FETCH_STATUS = 0
begin
EXEC msdb.dbo.sp_update_job @job_name=@jobName, @owner_login_name='new_account'
fetch next from curJobs
into @jobName
end
close curJobs
deallocate
curJobs
'Brain Trainning > DataBase' 카테고리의 다른 글
Minimal Logging changes in SQL Server 2008 (로그 최소화) (0) | 2010.11.25 |
---|---|
특정 Linked Server 의 계정번경 (0) | 2010.11.23 |
SQL Server 2005 DBCC Command Quick Reference (0) | 2010.11.16 |
CLR Stored Procedure Calling External Web Service (0) | 2010.11.16 |
Benchmarking SQL Server IO with SQLIO (0) | 2010.11.10 |