Aug 16, 2013

Sql script to get the current database in sql server


Sql query to get current working database:

SELECT DB_NAME() AS DatabaseName, DB_ID() DataBaseID

Sample output:

DatabaseName
DataBaseID
master
1

No comments:

Post a Comment