Query 2 servers in one SQL script
You can't use USE to change server context. You can use four-part naming for your objects, like Shawn suggested, if srvB is a linked server.

Another option is using SQLCMD mode, then you can say:

-- do stuff on server A
:CONNECT srvB
-- do stuff on server B


But that doesn't work well if you are trying to share data etc. between the two batches. For variables you can use SQLCMD variables instead.

More info here.