You were told already, that this storage is NOT recommended. Rather use 3 separate columns for this and compute the needed value on the fly when needed.
As this seems to be padded correctly it might be as simple as this:
DECLARE @tbl TABLE(Column1 INT, Column2 VARCHAR(1000));
INSERT INTO @tbl VALUES
( 1,'( 1, 1,1)')
,( 2,'( 45, 2,9)')
,( 3,'( 4456, 98,0)')
,( 4,'( 196416,511,1)')
,(97,'( 3213658, 45,7)')
,(98,'( 2315, 6,7)')
,(99,'(9999999999,999,9)');
SELECT *
,REPLACE(REPLACE(REPLACE(REPLACE(t.Column2,' ','0'),',',''),'(',''),')','')
FROM @tbl t;
Alternatively you can split this Column 2
and deal with the values separately:
--using the JSON-splitting here (needs v2016+)
--Below v2016 there are various splitting approaches (XML based, Jeff Moden's function and many more...)
SELECT t.*
,A.*
,CONCAT(REPLACE(STR(A.val1,10),' ','0')
,REPLACE(STR(A.val2, 3),' ','0')
,REPLACE(STR(A.val3, 1),' ','0')) AS [new key]
FROM @tbl t
CROSS APPLY OPENJSON(REPLACE(REPLACE(t.Column2,'(','[['),')',']]'))
WITH(val1 BIGINT '$[0]'
,val2 BIGINT '$[1]'
,val3 BIGINT '$[2]') A;
The result
+---------+--------------------+------------+------+------+--------------------+
| Column1 | Column2 | val1 | val2 | val3 | new key |
+---------+--------------------+------------+------+------+--------------------+
| 1 | ( 1, 1,1) | 1 | 1 | 1 | 00000000010011 |
+---------+--------------------+------------+------+------+--------------------+
| 2 | ( 45, 2,9) | 45 | 2 | 9 | 00000000450029 |
+---------+--------------------+------------+------+------+--------------------+
| 3 | ( 4456, 98,0) | 4456 | 98 | 0 | 00000044560980 |
+---------+--------------------+------------+------+------+--------------------+
| 4 | ( 196416,511,1) | 196416 | 511 | 1 | 00001964165111 |
+---------+--------------------+------------+------+------+--------------------+
| 97 | ( 3213658, 45,7) | 3213658 | 45 | 7 | 00032136580457 |
+---------+--------------------+------------+------+------+--------------------+
| 98 | ( 2315, 6,7) | 2315 | 6 | 7 | 00000023150067 |
+---------+--------------------+------------+------+------+--------------------+
| 99 | (9999999999,999,9) | 9999999999 | 999 | 9 | 99999999999999 |
+---------+--------------------+------------+------+------+--------------------+
update if below v2016
Before JSON one often used hack was something along this:
SELECT t.*
,A.*
,CONCAT(REPLACE(STR(A.AsXml.value('/x[1]','bigint'),10),' ','0')
,REPLACE(STR(A.AsXml.value('/x[2]','bigint'), 3),' ','0')
,REPLACE(STR(A.AsXml.value('/x[3]','bigint'), 1),' ','0')) AS [new key]
FROM @tbl t
CROSS APPLY(SELECT CAST(REPLACE(REPLACE(REPLACE(t.Column2,',','</x><x>'),'(','<x>'),')','</x>') AS XML)) A(AsXml);
Hint: In any case the result is a string and not a number. Otherwise you would not keep the leading zeros... But you might use CAST(... AS BIGINT)
to achieve a key as (big) integer number.