We are currently doing a 2010->2013 DB migration and attaching content databases back and forth. During the course of the migration I lost some notes on which content database belonged to which web application on the other end. These databases give no immediate indicator to where they were last attached to (someone gave them names of WSS_Content_<>). Is there any way (Microsoft supported or not) that I can investigate when they're merely attached and not mounted to SharePoint, any evidence of where they were attached too? I did find a table in the content database listing sites, but I'm not familiar enough with the underlying site structure to use this necessarily.
Since you mentioned "MS supported or not" , I am sharing this "non-supported" way of doing so.
Basically make a select * query to the table name [dbo].[DatabaseInformation]
It will return a result like this
There you will find urls of the previous web apps contained within the database before it was detached and taken to a different farm.