Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

field value generated

Status
Not open for further replies.

aonefun

Technical User
May 21, 2007
79
US
I have the following table fields: Zips.ZipCode, Zips.latitude,
Suppliers.ZipCode, Suppliers.latitude.

I would like to set the default value
of Suppliers.Latitude to equal the value of Zips.latitude WHERE
Suppliers.ZipCode = Zips.ZipCode



Please be
specific on what steps to take to accomplish this.
 
Specifically, you don't store the same information in two places. Why would the Suppliers latitude be different than the Zips latitude? If you are going to store the suppliers specific latitude then you don't need to store the zips latitude. Decide which entity (Suppliers or Zips) that the attribute (latitude) belongs to and store it there. Don't store it in two places.

Read the fundamentals document below for more on the rules of normalization.



Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual

Essential reading for database developers:
The Fundamentals of Relational Database Design
Understanding SQL Joins
 
I have the same idea of not storing duplicate data. However, This database is part of an asp application that I don't want to tamper with and it requires these specific fields.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top