sp_grantdbaccess cannot be run in a stored proc owned by DBO? Maybe I'm getting this wrong, but...
I have a SQL Server 2000 database with a stored procedure that is owned by DBO. This stored procedure is calling sp_grantdbaccess, which can be run by DBO, according to MS documentation.
and I'm running a Windows user that belongs to a database role that has execute permission on this stored procedure.

If I understand ownership chaining correctly (which I obviously don't), I should be able to run this stored procedure, since it is run with impersonation as DBO.

But alas, it is telling me that the user doesn't have permission to run sp_grantdbaccess.

What can I do to solve this?
Ownership chaining works only inside the database. sp_grantdbaccess lives in master and is therefore excluded from ownership chaining. Even worse, according to the sp_grantdbaccess topic in SQL Server 2000's Books Online:


  Only members of the sysadmin fixed server role, the db_accessadmin and db_owner fixed database roles can execute sp_grantdbaccess.


Erland Sommarskog wrote a great article on ownership chaining; however, it covers SQL Server 2005 and later, and there were some significant changes in the security model, so proceed with care when reading.

The only way I can think of to make this work is a hack: Create a loopback linked server and elevate the permissions that way: https://stackoverflow.com/questions/982782/sql-server-2000-execute-as

But be aware that that opens a big security hole.

So my best recommendation - I know you probably don't want to hear this now - is to upgrade to a more modern version of SQL Server.