Saturday, August 06, 2011

DB_NAME (Function)

 

This returns the name of the supplied DB_ID.If no argument is passed then the name of the current database is returned.The return type is nvarchar(128).

To find the current database name:-

select DB_NAME() as Current_Database_name;

go

select DB_NAME(6) as Database_name;

go

No comments: