<p>My account is in the securityadmin role and I cannot grant myself sysadmin permission. I wish to gain access to a database so I can add my account to a particular role within it. <br />
As I don't yet have access to the database I can't use the UI.</p>

<p>Does anyone know if this is possible and what SQL commands will achieve this in SQL Server 2005? <br />Thanks!</p>

The
sysadmin role
, as the name implies, can do anything within SQL Server. It has complete rights over the SQL Server. It is the only role that can add others to the sysadmin role. There isn’t anything within SQL Server a sysadmin role member can’t do.
You could use the system stored procedure
add_srvrolemember
to assign users to this role.
Example:
```
```
EXEC sp_addsrvrolemember 'BUILTIN\Administrators', 'sysadmin'
```
```