Transact-SQL?
Is it possible to do a SELECT that joins tables from 2 different databases, for example if Northwind database has a table Customer and Pubs database has a table Employee, how do I create a select statement that finds any duplicates ....
in MySQL you could do it like this:
select Northwind.Customer.Name
from Northwind.Customer join Pubs.Employee
on Northwind.Customer.Name = Pubs.Employee.Name
How does one do it in SQL server?
Thanks for reading!
in MySQL you could do it like this:
select Northwind.Customer.Name
from Northwind.Customer join Pubs.Employee
on Northwind.Customer.Name = Pubs.Employee.Name
How does one do it in SQL server?
Thanks for reading!
There are possible four dots (five elements) in an fully qualified identifier:
<Server> . <Database> . <Owner> . <Object> . <Column>
How many you need depends on your scope, but you generally can't skip one in the middle. Oh, and table aliases raise your quality of life.
SELECT c.Name
FROM Northwind.dbo.Customers c
INNER JOIN Pubs.dbo.Employee e
ON c.Name = e.Name
<Server> . <Database> . <Owner> . <Object> . <Column>
How many you need depends on your scope, but you generally can't skip one in the middle. Oh, and table aliases raise your quality of life.
SELECT c.Name
FROM Northwind.dbo.Customers c
INNER JOIN Pubs.dbo.Employee e
ON c.Name = e.Name
There are possible four dots (five elements) in an fully qualified identifier:
<Server> . <Database> . <Owner> . <Object> . <Column>
How many you need depends on your scope, but you generally can't skip one in the middle. Oh, and table aliases raise your quality of life.
SELECT c.Name
FROM Northwind.dbo.Customers c
INNER JOIN Pubs.dbo.Employee e
ON c.Name = e.Name
<Server> . <Database> . <Owner> . <Object> . <Column>
How many you need depends on your scope, but you generally can't skip one in the middle. Oh, and table aliases raise your quality of life.
SELECT c.Name
FROM Northwind.dbo.Customers c
INNER JOIN Pubs.dbo.Employee e
ON c.Name = e.Name