May 9, 2006 at 1:51 pm
Is there a way to change the owner of a DTS package without deleting it and recreating it?
sp_changeobjectowner doesn't work for DTS packages.
May 9, 2006 at 1:58 pm
sp_reassign_dtspackageowner. It's in msdb.
Greg
May 9, 2006 at 2:05 pm
Thanks Greg!
May 9, 2006 at 2:10 pm
This must be for SQL 2005, is there a SQL 2000 way to do it?
May 9, 2006 at 2:20 pm
Never mind. It threw me off when the color of the sp_reassign_dtspackageowner did not change in Query Analyzer. Since you pointed out that it is on MSDB database, would there be any problem going right into the table (sysdtspackages) and changing the owner?
May 9, 2006 at 3:20 pm
That would work. Make sure you update all versions.
Greg
Greg
May 10, 2006 at 2:30 pm
But I think if you modify the DTS package at a later date, it reverts back to the original owner.
I have some notes that I ran this script to change the owner ... experiment & see if it works (and STICKS !)
update sysdtspackages
set owner_sid = SUSER_SID('DOMAIN\New_User'),
owner = 'DOMAIN\New_User'
where name = 'DTS_PackageName'
May 10, 2006 at 7:38 pm
yep hombrew01. It can sometimes revert back to the original owner. That's been very frustrating for me. I will remember your tip.
Thanks, John
May 11, 2006 at 9:17 am
I've never had a package revert to a previous owner after changing it with sp_reassign_dtspackageowner. That's why I use it intead of modiying the system table.
Greg
Greg
May 11, 2006 at 9:26 am
Greg,
This procedure sp_reassign_dtspackageowner is expecting three parameters @name, @ID, @newloginname
I can guess that @Name means the name of the dts package and the @newloginname is self-explainitory, but what/where is the @ID coming from and how do I find it?
May 11, 2006 at 10:07 am
Jeff,
You can find the id in msdb's sysdtspackages table.
May 11, 2006 at 11:03 am
try this:
update msdb..sysdtspackages
set owner_sid = (select sid from master..sysxlogins
where name = 'sql login name')
where name = 'dts package name'
May 11, 2006 at 1:02 pm
Jeff,
Execute sp_enum_dtspackages in msdb. It will list all the package names and IDs. Just copy and past them into the parameters for sp_reassign_dtspackageowner.
Greg
Greg
March 27, 2008 at 9:55 am
How do you do it for all packages that are owned by domain\xyz, without having to do it one by one? If I use
update sysdtspackages
set owner_sid = SUSER_SID('DOMAIN\New_User'),
owner = 'DOMAIN\New_User'
where name = 'DTS_PackageName'
You are saying that it will revert back?
¤ §unshine ¤
March 27, 2008 at 10:11 am
You'd use the same update statement execept change the WHERE clause to
where owner = 'DOMAIN\Old_User'
As I said earlier in the thread, I've never had a package revert to a previous owner when it was modified by using sp_reassign_dtspackageowner. I'm not sure why the update statement would work any differently since it's the same statement that's in the stored procedure.
Greg
Viewing 15 posts - 1 through 15 (of 15 total)
You must be logged in to reply to this topic. Login to reply