You misunderstood the phrase
Requires membership in the sysadmin fixed server role, or ownership of
the database (dbo)
"ownership of the database" means that this login owns this database.
This is not the same as "is a member of db_owner database role
"
Owner
of a database is one single login
, while there may be as many db_owners as you want.
And in fact if you execute
exec sp_helptext 'sp_updatestats';
in the first rows you'll find:
declare @dbsid varbinary(85)
select @dbsid = owner_sid
from sys.databases
where name = db_name()
-- Check the user sysadmin
if not is_srvrolemember('sysadmin') = 1 and suser_sid() <> @dbsid
begin
raiserror(15247,-1,-1)
return (1)
end
This controls if the executor is a member of sysadmin
server role or he owns
this database: suser_sid() <> @dbsid
where @dbsid
is owner_sid
of current database
.
To find out the owner of some database you should execute
select owner_sid
from sys.databases
where name = 'some_db';
And you also can find it using SSMS:
