CURRENT_CATALOG
CURRENT_CATALOG is a SQL system function that returns the name of the current database. Its return type is varchar.
Example
Output
Explanation
The CURRENT_CATALOG
command, when run, returns the name of the current database. In the example above, the command returned ‘postgres’, which is the default database used by PostgreSQL.
Example
Output
Explanation
The CURRENT_CATALOG function in SQL Server returns the name of the current database. The SELECT CURRENT_CATALOG AS 'Current Database'
statement retrieves the name of the current database and displays it under the column named ‘Current Database’.