How to change the owner of SQL Server database tables

Source: Internet
Author: User

DBO is not the owner of the table casetable, so it cannot execute various SQL statements in the query analyzer. The prompt is:
Server: Message 208, level 16, status 1, Row 1
The object name 'casetable' is invalid.

Generally, the default owner of a table is DBO. Currently, several tables are not, so they cannot be connected using SA. How can I change it back to DBO?

Exec sp_changeobjectowner 'casetable', 'dbo'

Prompt after execution:
Server: Message 15001, level 16, status 1, process sp_changeobjectowner, row 38
The object 'casetable' does not exist or is not valid for this operation.
What's the problem? I used SA in the query analyzer to perform operations.

To include the current owner of the table, assume that the original owner is user1.

Exec sp_changeobjectowner 'user1. casetable', 'dbo'

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.