ERRORLOG contains thousands of entries for 'Starting up database' for a database that does not exist
As suggested in the title, my ERRORLOG is being swamped with notifications that it is starting a database, but the database it mentions does not exist (either in the SSMS Object Explorer or when doing `select * from master.sys.databases`). From its name, I can see that it certainly looks like one that might have existed once, but it certainly doesn't any more. I'm getting these entries 3-4 times every 10 or so seconds. There are no subsequent obvious error entries that might indicate a job or porcess that is causing this. How might I find out why SQL Server thinks this database exists and how would I go about removing it properly?
I think it is one of my devs creating snapshots like they're going out of fashion. He has a process going around ever 10s that is creating a snapshot, doing some work and then dropping it. It will be running every hour in live, but is running every 10s in test because he absolutely *must* have a quick turnaround for his tests! As for why it is doing it 3-4 times, I can only guess that he is not reusing his .NET SqlConnection to the snapshot and that it is set to AUTO_CLOSE (as per the comment by @ramesh-1) -- can one run `ALTER DATABASE snapshot_name SET AUTO_CLOSE OFF` against a snapshot?
That is not one I've seen before. First thing I'd do is run DBCC checks against all the system databases to ensure that they're in good shape. Check sys.database_recovery_status to see if there's an outstanding entry there. Not sure what to do if you find one, but that's where I'd look. Try issuing another DROP statement for that database (probably won't work). After that, I think I'd put extended events on the server to capture errors as they occur and errors written to the log just to see if it's possible to get more information than the log is providing. After that, I think it's time for a call to Microsoft.