Shrimpersfan Posted April 22, 2009 Posted April 22, 2009 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?
Pashers Posted April 24, 2009 Posted April 24, 2009 Hi there, you might want to look at something like: Update TableName Set FieldName = CustomView.Field From TableName Inner Join CustomView on TableName.PrimaryKeyField = CustomView.ForeignKeyField
pauljonze Posted April 24, 2009 Posted April 24, 2009 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...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now