Please check with this code, I was used in my project for extracting numeric value
Declare @str varchar(50)= 'userid7f(203001)31f469-NAIsasdsd'select substring(@str,patindex('%(%',@str)+1,patindex('%)%',@str)-patindex('%(%',@str)-1)OR
select substring(@str,charindex('(',@str)+1,charindex(')',@str)-charindex('(',@str)-1)OUTPUT= '203001'