Is there a way to detect, when running a script, the database that the current script window is showing? If yes, that would be nice as I have a script that will be executed by someone else and I need to make sure that the current database is not the main application database. Otherwise, it would wipe out a completely big table from the application. So, in the temporary database we are inserting some records from the main database, one of the first lines is a DROP TABLE. That is good but should only be executed if the current script window database does not correspond to a database name I would plug in the script.