How to change the owner of the User table of SQL Server 2000 to DBO instead of the user name?

Source: Internet
Author: User
Exec sp_changeobjectowner '[bbsdb]. [dv_style]', [DBO]
Change the owner of objects in the current database
When you back up and restore the database, the owner is often the original user, so that when you use
When the table name is invalid, an error message is displayed. if you add the original user name, an error occurs,
So the best way is to change it to DBO:
How to change the owner of the User table of SQL Server 2000 to DBO instead of the user name.
(The method for modifying the stored procedure is attached and executed in the queryer:
Exec sp_changeobjectowner 'usera. hishop_creatorder', 'dbo'), change the stored procedure of usera to DBO.
You can use sp_changedbowner to change the database owner.
Method 1: Right-click the table and choose design table from the shortcut menu. In the previous small icon, click the last "condition constraint" and click the "table" page to change the owner. (If there is no small icon with constraints, you can right-click to see a "Check constraint" option)
Method 2: Execute the script directly, log on to the database with a system account or a super user, and then execute the following statement:
Sp_configure 'Allow updates', '1'
Go
Reconfigure with override
Go
Update sysobjects set UID = 1 where uid <> 1
Go
Sp_configure 'Allow updates', '0'
Go
Reconfigure with override
The second method can only be used once. The second method may cause an error.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.