Replace text with input data How can I achieve this?

ValidationMessage table:

ValidationMessageID | Text
1                   | Item(s) &lt;ItemList&gt; do not exist in project &lt;ProjectID&gt;.
5                   | This value &lt;Value&gt; is invalid.


ReplacementValues table:

ValidationMessageID | ReplacementValues | Index
1  | &lt;614882,614889&gt;,&lt;8068637&gt;          | 10
1  | &lt;614882&gt;,&lt;8068634&gt;                 | 11
1  | &lt;614883&gt;,&lt;8068639&gt;                 | 12
5  | &lt;John Smith&gt;                       | 22


Expected Result:

ValidationText                                              | Index
Item(s) 614882,614889 do not exist in project &lt;8068637&gt;.    | 10
Item(s) 614882 do not exist in project &lt;8068634&gt;.           | 11
Item(s) 614883 do not exist in project &lt;8068639&gt;.           | 12
This value John Smith is invalid.                           | 22
The native string processing functions in TSQL are not very sophisticated and this approach requires parsing of the validation message to find items delimited by angle brackets. 

Then it requires splitting the ReplacementValue by comma (but not if the comma is inside an angle bracket) and finally removing the angle brackets and doing the replacement for each place holder by corresponding ordinal position. 

This could be done in TSQL but would likely require some poor performing scalar UDF - or alternatively would need to call out to CLR/Java code for more advanced string processing capabilities.

I suggest restructuring as follows

CREATE TABLE ValidationMessage 
(
ValidationMessageID int primary key,
Text varchar(2000)
)


insert into ValidationMessage
values 
(1,'Item(s) %s do not exist in project %s.'),
(5,'This value %s is invalid.');


CREATE TABLE ReplacementValues
(
ValidationMessageID INT, 
[Index] INT,
Param1 VARCHAR(50) NULL, 
Param2 VARCHAR(50) NULL, 
Param3 VARCHAR(50) NULL, 
Param4 VARCHAR(50) NULL, 
Param5 VARCHAR(50) NULL
)

INSERT INTO ReplacementValues(ValidationMessageID, [Index], Param1,Param2)
VALUES 
(1,10,'614882,614889','8068637'),
(1,11,'614882','8068634'),
(1,12,'614883','8068639'),
(5,22,'John Smith', NULL);


With an eye on making the final query simple with available functions

SELECT VM.ValidationMessageID,
       FORMATMESSAGE(Text, Param1, Param2, Param3, Param4, Param5),
       [Index]
FROM   ValidationMessage VM
       JOIN ReplacementValues RV
         ON RV.ValidationMessageID = VM.ValidationMessageID 


db &lt;> fiddle