How to change db owner for SQL Server 2000 database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • papayaya
    New Member
    • Aug 2006
    • 1

    How to change db owner for SQL Server 2000 database

    Our programmer has left the company and the tables and views were created with his credential as owner.
    How do I change the ownership of all the tables and views using the stored procedure - sp_changedbowne r?
    Instead of typing the individual table and view name to change the db owner, is there a way to change the owner at once?
  • ramasp
    New Member
    • Sep 2006
    • 19

    #2
    select * from sysobjects where xtype='u'

    The above command displays user tables. Get each user table name from sysobjects by using cursor or while loop pass the same as input parameter ot the sp_changedbowne r

    Try .....

    Comment

    • mishibala
      New Member
      • Sep 2006
      • 8

      #3
      or from enterprise manager,right click on users and from opened users adjust ur adjustments
      good luck

      Comment

      • Abdul Haque
        New Member
        • May 2007
        • 17

        #4
        Originally posted by papayaya
        Our programmer has left the company and the tables and views were created with his credential as owner.
        How do I change the ownership of all the tables and views using the stored procedure - sp_changedbowne r?
        Instead of typing the individual table and view name to change the db owner, is there a way to change the owner at once?

        hi dude have a look at this link http://support.microso ft.com/kb/275312

        Comment

        • jstone
          New Member
          • Jun 2007
          • 1

          #5
          use [currentdatabase]
          go
          sp_changedbowne r 'yourusername', 'true'
          go

          This will change the owner of the current database to whatever username you want ( you could put sa in there ) and then remap any alias as well (that's the true).

          // John Stone

          Originally posted by papayaya
          Our programmer has left the company and the tables and views were created with his credential as owner.
          How do I change the ownership of all the tables and views using the stored procedure - sp_changedbowne r?
          Instead of typing the individual table and view name to change the db owner, is there a way to change the owner at once?

          Comment

          • shrimant
            New Member
            • Sep 2007
            • 48

            #6
            In SQL Server Management Studio 2005:
            1/ Right Click on the Database node
            2/Click Properties
            3/Select Files
            4/There would be a Owner Text Box, change the new Owner Name or browse and select the new Owner.

            Shrimant Patel
            &
            Harith Patel
            Last edited by shrimant; Sep 26 '07, 07:26 PM. Reason: Typo error

            Comment

            Working...