Hi there I am trying to update a field in our contact table. I have a view which contains all of the contacts that i need to run the update for, my question is:
How do i update a contact table but only update the contacts that are in my custom view?
Hi there I am trying to update a field in our contact table. I have a view which contains all of the contacts that i need to run the update for, my question is:
How do i update a contact table but only update the contacts that are in my custom view?

You need a JOIN clause.
Hi there, you might want to look at something like:
Code:Update TableName Set FieldName = CustomView.Field From TableName Inner Join CustomView on TableName.PrimaryKeyField = CustomView.ForeignKeyField
If all columns are the same I'd use something like:
select *
from (select * from old_data_table_name)
union
select * from new_data_view_name)
into temp_data_table
drop old_data_table
select *
into old_data_table_name
from temp_data_table
drop temp_data_table
Bit rough and ready because you're creating a new table of contacts and need to drop the old contact table but it works...![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)