change db owner name without affecting the objects?

  • our developer left the company and he has created numerous of objects such as the store procedures views, and triggers using his name as a dbo owner. I have found out the the objects that he owned but I need to know how to find out his db owner name in the script or objects. Is there a way to do it? Thanks.

  • DBO is tied to a role in sql server.

    Do the objects say dbo.storedprocedurename?

    Or do they say username.storedprocedurename?

    if they say the user name, then they are not assigned to dbo.

    if it already says dbo. then there is nothing you should need to change. Except remove that users name from the database, and off the servers.

    Can you please provide examples of object names.

    Try sp_rename

    sp_rename

    Changes the name of a user-created object (for example, table, column, or user-defined data type) in the current database.

  • for example it states dpeter.storeprocedurename instead of dbo.storeprocedurename. I also need to find out the dependency objects of the dpeter.storeprocedurename. Is there  way to find out?

  • Try sp_changeobjectowner

  • To find dependencies for the stored procedure, run this in Query Analyzer:

    sp_depends 'dpeter.storedprocedurename'

    Greg

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply