Hi,<br>
<br>
Do you know if it is possible to link table in SQL Server as like it is possible in MSAccess ?<br>
<br>
Thanks in advance.<br>
<br>
Alain.
This is called a "join" and is used when you want to combine information from two or more tables into one result set. First, the two tables must have a common field, such as "emp_id". Suppose the table "employees" has two fields, one is "emp_id" and the other is "lname". Further, suppose the table "addresses" has two fields, one is "emp_id" and the other is "city". If you want to obtain a result set consisting of the employee last name and the city they live in, you would write your query like this:<br><br>select lname, city<br>from employees, addresses<br>where employees.emp_id = addresses.emp_id<br><br>There are other factors involved, such as, if the column name appears in both tables, you must qualify the column name with the table name, and aliasing the table names can shorten your query, but that's the gist of it.<br><br>Hope this helps!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.