I need to get the name of the database I'm currently running in (for use in the URL column).
I know that I can get the server name using @@ ServerName. But no @@ DatabaseName.
How can I get the database that is currently running?
Try using this:
select DB_Name()
Example database change:
use master select DB_Name() use model select DB_Name()
You can use DB_NAME () to get the database name.
SELECT DB_NAME() AS DataBaseName
You can use this function to get the name of the database you are currently using.
select DB_NAME ()