Modify the table owner in batches:Exec sp_msforeachtable 'exec sp_changeobjectowner ''? '', ''Dbo '''Modify the table owner:Exec sp_changeobjectowner 'name of the table to be changed ', 'dbo'
"? ": Name of the original owner. It is equivalent to a
Change the current owner of the SqlServer object to the target owner.
Change the current owner of the SQL Server Object to the target owner.
In database operations, you will use objectowner when the Database Object List contains more than one
Batch modification:Exec sp_msforeachtable 'exec sp_changeobjectowner ''? '', ''Dbo '''Single modification:Exec sp_changeobjectowner 'name of the table to be changed ', 'dbo'
Only the owner can change the table owner.
Very server: Message 15001,
Sp_changeobjectownerChange the owner of objects in the current database.
SyntaxSp_changeobjectowner [@ objname =] 'object', [@ newowner =] 'owner'
Parameters[@ Objname =] 'object'
Name of the existing table, view, or stored procedure in the current
In database operations, you will use Objectowner.objectname to refer to objects when the list of database objects does not have a common element--objectname, but you can use system stored procedures if you need to change the owner of the objects in
In database operations, you will use objectowner when the Database Object List contains more than one common element, objectname. objectname to reference objects, but if you need to change the owner of objects in the current database, you can use
To change the table owner, I currently know two methods:
1. sp_changeobjectowner
Change the owner of objects in the current database.
SyntaxSp_changeobjectowner [@ objname =] 'object', [@ newowner =] 'owner'
Parameters[@ Objname =] 'object'
Name
In database operations, you will use objectowner when the Database Object List contains more than one common element, objectname. objectname to reference objects, but if you need to change the owner of objects in the current database, you can use
server| objects
In database operations, you will use Objectowner.objectname to refer to objects when the list of database objects does not have a common element--objectname, but you can use system stored procedures if you need to change the owner of
Problem Description:
Copy to a database db, appended, the object's owner is not admini, each query must write select * from admini.*** to be found. Is there any way to not use the front admini (without modifying the owner). Note:
Already under
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.