It didn't happen to me YET. But I was thinking about this.
I was messing around with my training environment, and by mistake I clicked in the database name, and then I touched the letter A.
Let's assume that I hit enter. Now the database is called A, and I don't remember the original name. CTRL + Z doesn't work.
What to do in a case like this, in a production environment?
I know it could not happen, because the database isn't set as SINGLE USER. But if it happens. What to do? For argument's sake, let's say it's a database that nobody is using right now.
ALTER DATABASE
permissions and only log in as that user when I actually want to run anALTER DATABASE
script. That way you'll never do the above