patternsqlModerate
Is it ever harmful to set a database owner in SQL Server?
Viewed 0 times
ownerharmfulsqldatabaseservereverset
Problem
There are a bunch of databases on one of our SQL servers that have no owner. Generally speaking, is it harmful to give them one? For example:
I know sa may not be the best choice, but it is just an example. My primary concern is whether or not creating an owner when there is none may cause issues with software that can currently connect OK.
USE dbName;
GO
EXEC sp_changedbowner 'sa';
GOI know sa may not be the best choice, but it is just an example. My primary concern is whether or not creating an owner when there is none may cause issues with software that can currently connect OK.
Solution
You should be using DDL instead of backward compatibility stored procedures:
And the owner of the database (never mind
ALTER AUTHORIZATION ON DATABASE::dbName TO sa;And the owner of the database (never mind
sa) should probably not be the account that your applications use, so this should not really have any effect on your applications. If it does then you should update the connection strings your application uses (which shouldn't be a major change) and make sure the account has sufficient - but not God - privileges.Code Snippets
ALTER AUTHORIZATION ON DATABASE::dbName TO sa;Context
StackExchange Database Administrators Q#37058, answer score: 12
Revisions (0)
No revisions yet.