I have the following string.
Input -------------- 2030031469-NAI
To get the numeric part, I am using the following script
select left(@str, patindex('%[^0-9]%', @str+'.') - 1)