The T-SQL USE statement only allows a database name specification. It is up to the client application or tool to connect to the desired server before executing USE.
SSMS (in SQLCMD mode) and the SQLCMD utility provide a CONNECT command to dynamically change the database connection. You can include a CONNECT command in scripts executed with these tools. The server and database context reverts back to the initial server and database after script execution For example:
:CONNECT .
USE master;
SELECT @@SERVERNAME AS CurrentServer, DB_NAME() AS CurrentDatabase;
GO