I have a table which contains specific words.

[![enter image description here](https://i.stack.imgur.com/tbV4Y.png)](https://i.stack.imgur.com/tbV4Y.png)

Now when I insert a new post I want to replace the vowels in the strings that the word table contains before it is being inserted. So that's why I need to use a trigger function with instead of insert.
I got this so far:

```
Create TRIGGER trChangeAbusiveWord
ON Post
INSTEAD OF INSERT
AS
BEGIN

Declare @abusiveWord nvarchar(max)
Declare @correctedWord nvarchar(max)

Select @abusiveWord = b.Woord FROM Scheldwoorden b WHERE exists 
    (select Message FROM inserted a where a.Message like '%' + b.Woord + '%')

Select @correctedWord = REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(@abusiveWord, 'A', '*'), 'E', '*'), 'O', '*'), 'U', '*'), 'I', '*')

Select Replace(Message, @abusiveWord, @correctedWord) FROM Message b
When done changed words, insert query here.

END

```

Now when I insert this message:

```
INSERT into Post(Id_User, Id_Topic, Titel, Message) VALUES (7,1, 'TriggerMe', 'Hi im bear and I want to cook a nice meal')

```

I want to change the message to 'Hi im b--r and I want to c--k a nice m--l'

But with what the queries I got so far, it only changes the first word like this:

'Hi im b\*\*r and I want to cook a nice meal'