|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Primary Key Problem
hi
I am using two same databases, db1,db2. db1 in offline.db2 in online.In db1, one record is inserted with id as 10. similarly, in db2 ,another different record is inserted with id as 10.how to synchronise this two tables ? ??? Uma |
|
#2
|
|||
|
|||
|
Is the primary key set as an identity column?
Are there other tables that reference the primary key in this table? |
|
#3
|
|||
|
|||
|
Primary key Problem
Quote:
hi Thanks for ur help!!! Yes, primary key set as an identity column. 4 - 5 tables are referring this table. In DB1 (Offline Processing), in table USERS - >new record is added & userid is generated as 51. In DB2(online Processing), in table USERS - >new record is added & userid is generated as 51. Both Processing are independent.If admin wants to Upload/Download the changes in both the databases, this primary key conflict arises. B'coz in both tables (table name : USERS),a record with userId as 51 exists and userId should not be changed. My requirement is after upload/download function, both databases should be same (synchronising both the databases) Is there any other solution to solve this problem?? Thanks uma |
|
#4
|
|||
|
|||
|
Not without changing the user id's in one table or the other. It has to change somewhere. Also, is modifying the tables and possibly the application using the tables an option?
The only other option would be to change the primary key to username or something along those lines and lose the identity property on the userid column. |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > Primary Key Problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|