How can I update two tables with the same record using different id's?
First record:
1 Mexico Cancun
Second record:
2 Mexico Cancun
The first columns id does not match the column id located in another table. I'd like to update by id, whenever someone updates existing records across both tables. So if table one is updated so is table 2. Also, there are discrepancies between the existing columns across both tables. They are the same record but do not match identically.
I'm calling this inside a stored proc that updates table one but since table two does not have the same id it is not updated. Thank you for your patience.
First record:
1 Mexico Cancun
Second record:
2 Mexico Cancun
The first columns id does not match the column id located in another table. I'd like to update by id, whenever someone updates existing records across both tables. So if table one is updated so is table 2. Also, there are discrepancies between the existing columns across both tables. They are the same record but do not match identically.
Code:
select @Id = @ExistingId
update Country set country_nm = @country_nm,
city_nm = @city_nm
where id = @id
I'm calling this inside a stored proc that updates table one but since table two does not have the same id it is not updated. Thank you for your patience.