How to change an MSSQL database owner (dbo)
If you moved your database from one MSSQL server to another, and you encounter difficulty with User ID's or Logins, or tables are not accessible, it may be due to the MSSQL database owner assigned to your database. For example, if you moved the database to a server that does not have the same database owner/users/roles setup, your new server may not recognize the tables because it has no access to them. To fix an issue like this, you should contact a Microsoft Certified MSSQL Administrator.
PLEASE NOTE: This is an advanced task, and not covered by our support, we recommend that you Contact Us for a quote, we have a certified database administrator on hand that can handle it for you.
Your MSSQL Administrator can run the stored procedure for changing the database table owner (dbo), or in many cases by simply using the Microsoft SQL Manager software.
To change the database owner using a stored procedure, you'd run something like this as a Query:
USE databasename EXEC sp_changeobjectowner 'currentownername.tablename', 'newownername'
Or, on currently logged in Database run:
EXEC sp_changeobjectowner 'currentownername.tablename', 'newownername'
Substitute databasename with name of your database, and substituting the owner name wih the current database owner (User Name). You can execute sql similar to that using Microsoft's SQL Query Analyzer.
BELOW ARE ADDITIONAL EXAMPLES:
EXEC sp_changeobjectowner 'old_dbo.affiliates', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.category', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.catlinks', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.countries', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.creditcard', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.customer', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.custompages', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.discounts', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.gateway', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.giftcert', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.giftopt', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.itemimages', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.itemlinks', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.itemprices', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.items', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.menutabs', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.optioncat', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.optionitem', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.orderdetail', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.orders', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.pd_commondata', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.pd_eventlog', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.pd_setup', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.reviews', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.security', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.shipping', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.shiprates', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.states', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.status', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.wlistdetail', 'dbo'
REPLACE old_dbo and dbo with the correct database owners.
Again, PLEASE NOTE: This is an advanced task, and not covered by our support, we recommend that you Contact Us for a quote, we have a certified database administrator on hand that can handle it for you.
PLEASE NOTE: This is an advanced task, and not covered by our support, we recommend that you Contact Us for a quote, we have a certified database administrator on hand that can handle it for you.
Your MSSQL Administrator can run the stored procedure for changing the database table owner (dbo), or in many cases by simply using the Microsoft SQL Manager software.
To change the database owner using a stored procedure, you'd run something like this as a Query:
USE databasename EXEC sp_changeobjectowner 'currentownername.tablename', 'newownername'
Or, on currently logged in Database run:
EXEC sp_changeobjectowner 'currentownername.tablename', 'newownername'
Substitute databasename with name of your database, and substituting the owner name wih the current database owner (User Name). You can execute sql similar to that using Microsoft's SQL Query Analyzer.
BELOW ARE ADDITIONAL EXAMPLES:
EXEC sp_changeobjectowner 'old_dbo.affiliates', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.category', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.catlinks', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.countries', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.creditcard', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.customer', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.custompages', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.discounts', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.gateway', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.giftcert', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.giftopt', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.itemimages', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.itemlinks', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.itemprices', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.items', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.menutabs', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.optioncat', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.optionitem', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.orderdetail', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.orders', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.pd_commondata', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.pd_eventlog', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.pd_setup', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.reviews', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.security', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.shipping', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.shiprates', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.states', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.status', 'dbo'
EXEC sp_changeobjectowner 'old_dbo.wlistdetail', 'dbo'
REPLACE old_dbo and dbo with the correct database owners.
Again, PLEASE NOTE: This is an advanced task, and not covered by our support, we recommend that you Contact Us for a quote, we have a certified database administrator on hand that can handle it for you.
Related Articles
Related Topics
Search for help...