What happens if updating cursor did not fetch any records
The table structure's aren't the same so we are only populating some fields and have to do some trimming, etc to get things to fit.This sync happens the other direction as well (when someone adds a record to the corresponding table on the 2005 system it INSERTs a record on this side).I tried that and it worked for those records that the address was different.The issue is it may be one of any of the 173 fields that are different or the entire row may be an exact duplicate. Do you wonder if your IT business is truly profitable or if you should raise your prices?It takes a while to run about 3 minutes on less than 100,000 records.Here is the modified code I am using: Declare @idphone nvarchar(10), @cnt int Declare getallrecords cursor local static For Select count (1), ophone from tmpimport (nolock) group by ophone having count(1)1 Open getallrecords Fetch next from getallrecords into @cnt,@idphone --Cursor to check with all other records While @@fetch_status=0 Begin Set @cnt= @cnt-1 Set rowcount @cnt -- updating the fields that are duplicates leaving one update tmpimport set procflag = 'D' where [email protected] Set rowcount 0 Fetch next from getallrecords into @cnt,@idphone End Close getallrecords Deallocate getallrecords Is there any other way this can be done, much faster?I have a trigger which adds records to Table B when records are added to Table A.
i want to update product_master table, whenever i delete a record from a master-detail form.
TMPIMPORT a INNER JOIN (SELECT ophone , max(ophone ) AS Dups FROM dbo.
TMPIMPORT GROUP BY ophone HAVING (COUNT(*) rafrancisco, Thanks for the info.
I was unable to resolve this problem and for the time being have removed the update statement to get the trigger to work.
I'd love to have it working with the update, however, so if you want me to check settings on either SQL server I'd be glad to do it.