Change DTS Package Owner?

  • 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.

  • sp_reassign_dtspackageowner.  It's in msdb.

    Greg

  • Thanks Greg!

  • This must be for SQL 2005, is there a SQL 2000 way to do it?

  • 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?

  • That would work.  Make sure you update all versions.

    Greg

    Greg

  • 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'

     

  • 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

  • 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

  • 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?

     

  • Jeff,

     

    You can find the id in msdb's sysdtspackages table. 

  • try this:

    update msdb..sysdtspackages

    set owner_sid = (select sid from master..sysxlogins

                where name = 'sql login name')

    where name = 'dts package name'

  • 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

  • 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 ¤

  • 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