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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

newbie table design

Status
Not open for further replies.

ironvid

IS-IT--Management
Sep 2, 2003
10
GB
If anyone can help with my ms sql 2000 I have this question:-

I am designing two tables :

Batch
Documnets

In both tables i have two fields called "page" and "name"

all the names in the name field are unique

How can I design the page field in the batch table to be updated with the information from the page field in the documents table automaticlly where the name field match's

How this makes sense

please make it simple still a newbie

thanks....
 
So you have BATCH(Page, Name) and (I guess you meant)DOCUMENTS(Page, Name)?

Both fields in both tables are confusing, do the Page and Name fields in the documents' table contain exactly the same type of information that is in the first table?

Explain what data you would like to store in each table so I can assist you with the design.

As for the update it is just about writing the UPDATE statement with a JOIN or a WHERE clause but the tables need to be properly normalized first.
 
Does this make more sense

------------------------
Table 1

Name - DOCUMENTS
Fields:

ID
Name -(Type)varchar (length)80 (no Nulls)
Page -(Type)text (length)16 (no Nulls) date
Date
------------------------
Table 2

Name - Batch
Fields:

Name -(Type)varchar (length)80 (no Nulls)
Page -(Type)text (length)16 (no Nulls) date
Count

------------------------------------------------------
I want the batch database to look at the documnets database and find matching name fields

where the name fields are matching to insert the information from the page field in the documents table into the page field in the batch table automaticlly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top