Wednesday, January 23, 2013

What is the current database name

It seems I've lost the ability to retain even the basic SQL information that I've learned over the years.  For the life of me I couldn't remember how to view what the current database name was. 

Fortunately Google has become my memory and my crutch. 

SELECT DB_NAME() AS DatabaseName

select db_Name() as DatabaseName - SQL Server

No comments:

Post a Comment