how to populate a fields in table1 only with related records fromtable2

P

Parvaiz Ahmed

Hi,
HELP!!
I have 2 tables.
say table1 has just 2 fields. One called 'ReferenceNbr' which is already populated, and the other called 'Directorate' which is empty at the moment.
Now I also have a larger table (Table2). Table2 also has the same 2 fields (amongst others) and has say 5000 records in it.
The common relationship between the 2 tables is the 'ReferenceNbr' field.
I am trying to populate Table1.Directorate from Table2 where their ReferenceNbr's match, but I keep ending up with hundreds of duplicate fields in Table1.

I hope this makes sence.
Can someone please tell me where I'm going wrong?

Many Thanks



Submitted via EggHeadCafe - Software Developer Portal of Choice
SQL Server Query Analyzer Runs Fast - Stored Procedure Runs Slow
http://www.eggheadcafe.com/tutorial...4-750c1ce4e423/sql-server-query-analyzer.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top