Ok, so this probably doesn't happen often, where some code doesn't know on what server or database it is operating on, but needs to know this information... To be honest, I created this as I was able to logon to someone's DotNetNuke site as an admin, but did not have direct access to the website files. The site owner asked where the database resided. So I went to the Host->SQL menu option, which lets you run dynamic sql against your database. And I typed this command in to discover the server and database name that DNN was using:
SELECT @@servername as ServerName, db_name() as DatabaseName
@@servername resolves to the name of the database server, and db_name() resolves to the "default" or current database.
Quite simple, I am posting it just in case someone else may find this useful some day.