update column

gogaak

Registered User.
Local time
Today, 04:59
Joined
Feb 6, 2005
Messages
42
replicate column

helo all,

I have two tables I want to copy all the contentc of column in tableA to coumn in tableB. Both the columns are primary key of respective tables. .


One more doubt-- Can i have primary key of two tables with same name...
Example: Table A
columns( TokenID, Name, locatin, status)
Table B
columns( Token ID, DivisionID, DeptID)

( I suppose it doesnt make any sense to do this). But can it help in some situations?
 
Last edited:
Why not just have TableB with it's own PK (maybe an autonumber) and then have a FK (Token ID) pointing back to tableA?
 
Access, and the other relational databases, don't really care what a column is named except that the name needs to conform to the rules it uses. Access is very flexible in that it allows embedded spaces and special characters. Most other RDBMS's are much stricter in how field names are formed.

I would think that it would be confusing to you to have two independent tables who's primary keys are the same name. Occassionally, you might have a need to copy a table for test purposes or whatever. Access won't care that you have tblA and tblB which have an identical set of column names. Names only need to be unique within their scope. So, each column name within a single table needs to be unique. But, in a properly structured database it is very common for the same column name to appear in multiple tables. You see this most often with foreign keys. The customer ID in tblCustomer would be CustomerID. The foreign key in tblOrder that identifies the customer who placed the order would also be CustomerID. Although it is not necessary that the pk and fk share the same name, it is a convention followed by most experienced developers because it makes it easier to "see" the relationships between tables at a glance.
 
thanx for the Info mate....
That definitely gave me some sense...

:)
 

Users who are viewing this thread

Back
Top Bottom