I have four columns of data in one table (frequency) within the same database that I wish to append/update into another table (company). I have tried an insert to statement but that didn't work due to the statement trying to create rows of which some of the fields cannot accept a null value.
I have revised my approach by using the attached code as means of trying to match the counter columns values to the same field in my company table. This code managed to loop through (incrementally) the company table and from this I would like to know if it would be possible for me to use possibly an IF statement to populate the company table with the fields from the frequency table when they are equal to each other, as both tables have a common realtion via the counter field?
Your help is much appreciated in advance
DECLARE @counter int
SET @counter = 0
SET @counter = counter = @counter + 1