i have one column with this values, i want this column have x-xxxxxx-xxx-xxx template,x is number
## codel ##
1-829549-305-117
1-1196585-305-119
119.305.1983984.1 // this record not custom template
1-224594-305-121
1-1999987-305-121
122.306.113416.1 // this record not custom template
1-158059-305-122
1-1083888-305-126
for convert Records that do not have the default format is :
example :
DECLARE @myvar varchar(20);
SET @myvar = '119.305.1983984.1';
SELECT CONCAT(PARSENAME(@myvar,1),'-',PARSENAME(@myvar,2),'-',PARSENAME(@myvar,3),'-',PARSENAME(@myvar,4))
result must be :
## codel ##
1-829549-305-117
1-1196585-305-119
1-1983984-305-119 // this record fixed
1-224594-305-121
1-1999987-305-121
1-113416-306-122 // this record fixed
1-158059-305-122
1-1083888-305-126
thanks for read my question