Search code examples
sql-servert-sqldbo

How to check if I'm currently the database owner for SQL 2000/2005/2008


I can't remember how to do this in a TSQL query. It was a one-liner, good for testing before running DML. The query was something similar to SELECT IS_DBO() or SELECT IS(DBO).


Solution

  • You're probably looking for the IS_MEMBER function:

    SELECT IS_MEMBER('db_owner')