Depends on the rules of engagement. If they're allowed to fire at will at anything with two legs coming over the border, then yes, that will work, provided there are enough LEOs to watch every linear inch of border between Brownsville and San Diego.
Any rules other than those aren't gonna change a damn thing.
Build the fence.
And then they will start using boats in the Gulf to go AROUND the fence. They already dig tunnels to go under. and makeshift ladders to go over.
Waste of time and money!