I would like to get a substring 403162 from the given string Praveen(403162) in sql?
Declare @Name VARCHAR(100) Select @Name = 'Praveen(403162)' Select @Name = SUBSTRING(@name,PATINDEX('%[0-9]%',@Name),LEN(@Name)) Select SUBSTRING (@Name,1,6)