T-SQL 101: 30 Changing databases with the USE statement in T-SQL
Take a look at the following query:

I’ve asked for a list of the databases from the sys.databases view. But rather than executing it against whichever database I was already connected to, I’ve said USE master; to change to the master database.
The command will be sent to the master database instead of any other database that I might have been connected to. At that point, master becomes my “current database”.
2019-08-12

Awesome image by Mathyas Kurmann[/caption]