database owner 'dbo'
wojtek
Posts: 4
Hallo,
I synchronized the local database with the production database but the production database does not have any tables.
The local database and the production database have different owners. Nevertheless I get for a new table in the production database a 'dbo' owner: [dbo].[tbl_name].
How can I prepare the property for the synchronization in order to get the correct owner.
Thank you for your help.
I synchronized the local database with the production database but the production database does not have any tables.
The local database and the production database have different owners. Nevertheless I get for a new table in the production database a 'dbo' owner: [dbo].[tbl_name].
How can I prepare the property for the synchronization in order to get the correct owner.
Thank you for your help.
Comments
What happens is that if the table was created with implicit ownership:
CREATE TABLE MyTable
it inherits the ownership of the logged-in user, ie dbo. The same things happens when you run the SQL Compare migration script. If the script is creating table names with no owner name, you need to be logged into the SQL Server as that user so the correct ownership is inherited.
Any user who is a member of the db_owner role will cause the object to be created with dbo ownership as well!
what this of course is, has to be seen clearly simply sometimes :oops: