Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我不记得如何在 TSQL 查询中执行此操作。它是单行的,适合在运行 DML 之前进行测试。该查询类似于 SELECT IS_DBO() 或 SELECT IS(DBO)。
您可能正在寻找以下IS_MEMBER功能:
IS_MEMBER
SELECT IS_MEMBER('db_owner')