SQL Server 2000: how do I return only the number from a phone number column
问题 I'm trying to strip out the "(", ")", "-", "x" or "X" "ext" and spaces from each phone number so I am left with only the first 10 digits or 1st 10 numbers of a phone number. Is there a simple way to allow only the first 10 digits to pass through in sql 2000. I was thinking about using replace but it requires a replace for each character or group of characters and is not very neat. Is there a way with a standard install of sql2000 to return only the first 10 numbers. Examples before and after