Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Computer Forums > Programmers Lounge > Programming Discussions » collating records from different SQL Server tables
Closed Thread
Old 03-16-2009, 01:23 AM   #1 (permalink)
 
Junior Techie

Join Date: Nov 2008

Posts: 79

BobLewiston is on a distinguished road

Default collating records from different SQL Server tables

I'm starting to learn SQL Server. As part of that effort, I'm experimenting with accessing AdventureWorks sample databases.

In database AdventureWorks, I've been accessing table Person.Contact. Although in that table there are columns for a phone number and an email address, there are no columns for a postal address. I see columns for a postal address in table Person.Address, but in that table there is no column for a numerical value ContactID, or for a string value for the contact's name, as there is in table Person.Contact.

It seems to me, especially because each of these two tables' names start with "Person.", that these tables are somehow linked. However, I don't see any columns in either table which seem to allude to any other tables. For what it's worth though, each of the two tables has a column called "rowguid", the purpose of which I don't understand.

I'd like my app to display in a WinForm all the information available for each contact, but I don't know how to locate the Person.Address record corresponding to a given Person.Contact record. Can anybody tell me how to do this?
BobLewiston is offline  
Old 03-16-2009, 08:03 AM   #2 (permalink)
office politics's Avatar
 
It's all just 1s and 0s

Join Date: Jan 2004

Location: in the lab

Posts: 4,389

office politics will become famous soon enough

Default Re: collating records from different SQL Server tables

GUID short for globally unique identifier.

onec you find a record you wish to dispaly in one table, you should be abel to query other tables with "where rowguid = '<value>'" to find information on the same person
office politics is offline  
Old 03-20-2009, 09:53 AM   #3 (permalink)
 

Join Date: Jul 2005

Location: England

Posts: 2,040

kmote has a spectacular aura aboutkmote has a spectacular aura about

Default Re: collating records from different SQL Server tables

I'll need to see the structure of the tables including the indexes. If this is an example database, it may be trying to demonstrate the use of linking tables even though this would not be done in production.
__________________
MSI P43 Neo|Enermax Pro82+ 425W|E5200|silent 8500GT|250GB Samsung spinpoint F1|Samsung SATA DVD RW|4GB Corsair|Antec SOLO|openSUSE11


There are in order of increasing severity: lies, darn lies, statistics, and computer benchmarks. - diskinfo man page
kmote is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to obtain SQL Server FullText Search service? BobLewiston Programming Discussions 9 08-14-2009 08:24 AM
I can’t install SQL Server 2008 Express with Advanced Services - Help! BobLewiston Windows Operating Systems and Software 9 03-12-2009 09:00 AM
windows 2003 server? 808Alaska Windows Operating Systems and Software 13 02-28-2009 12:19 AM
Terminal License Server - Expired !! roumieh2000 Windows Operating Systems and Software 2 09-04-2008 01:46 AM
SQL server error wicked23 Windows Operating Systems and Software 6 03-05-2008 05:28 PM