I'm new to SQL, so need a little help. I have to join two tables which are in two different databases which are on different servers. Can someone please tell me how can I do that?
You sure can, as long as you have permission to access the tables on the other server. Just qualify the table names with the server name, database name, and schema name, like so:
You'll have to first set up the remote server as a "linked server" - you should be able to find plenty of guides for doing that with a little Google searching, or just pester your local DBA. It's pretty easy when connecting two SQL Server systems, but Kerberos can be a little fussy if you want to impersonate Windows credentials.