How to query the name of the current SQL Server database instance? August 11, 2023 by Tarik SELECT DB_NAME() Returns the database name.