UsageThe CURRENT_DATABASE function returns the current database's name as a string.
Examples
-- This script backs up the current database
SCRIPT
BEGIN
EXECUTE IMMEDIATE 'BACKUP DATABASE "' + CURRENT_DATABASE() + '" AS "' +
CAST(CURRENT_DATE AS VARCHAR(10)) +
'-' + CURRENT_DATABASE() +
'" TO STORE "Backups" INCLUDE CATALOG';
END
SQL 2003 Standard DeviationsThis function deviates from the SQL 2003 standard in the following ways: