A319
Air Traffic Control Fully Certified
Air Traffic Control Time Certified In Pos 1 (yrs) 16
Human-Machine Interface; Situational Awareness
ATC Issue All Types; Airspace Violation All Types; Deviation / Discrepancy - Procedural Published Material / Policy
ATC Equipment / Nav Facility / Buildings; Human Factors
Aircraft X was in Canada's airspace squawking the wrong code of XXXX. Code XXXX was assigned to Aircraft Y who was already in my airspace. When I went to track up Aircraft X I did a 'track pick XXXX'. This moved the track from where Aircraft Y was and moved it up into Canada's airspace to the XXXX code there. I was busy and did not realize that this track was moved from the actual Aircraft Y who was approximately 175 miles south of Aircraft X. I realized that this is the wrong call sign and drop the track. Since it was over 150 miles away the track did not go back to where Aircraft Y actually was. I started a track for Aircraft X and when he came over I assigned him his code of XXXZ and it paired. Aircraft Y flew through my airspace without a track for over 100 miles without me even noticing it. As the intruder target approached the next sector they happened to notice it and started a track and initialized the inquiry as to what happened.Somehow a track should not be allowed to be moved off an existing target to a target in Canada's airspace and if it does it should be able to go back to its original target once dropped from the wrong target.
Salt Lake Center Controller reported routing confusion due to two aircraft using the same squawk code.