If I want to know the server I can use:
@@SERVERNAME
Is there an equivalent function for getting database/catalog name.
I know that we can set it in the script with USE
statement but what if it wasnt set and I wanted to query within a sproc what db I was using.
db_name()
will give you the name of the current database.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With