Trying to figure out a trigger but I just can't understand how to do it, tried looking it up but cant find a similar example. I am trying to break up a string that says something like - Existing 50mm Carlon to Fire Hall install controller cable to operating switchI am having no problems breaking the string up and creating a temporary table that splits it into individual strings with their own Position defined as an integer. Now what I can't do is take these individual fields and combine them into another string but only until the length of this new string is not more than 20 characters. The end result would look something like -string 1 - Existing 50mm Carlon to string 2 - Fire Hall Installstring 3 - controller cable tostring 4 - operating switchBelow is my SQL code that splits the strings into a new table and attempts to make them into new strings with a 20 char limit. I know there are obviously problems with my loop (setting the final word) as the result is -Existing 50mmCarlon toFire Hallinstall controllercable tooperating switchAny help appreciated to get these to 20 characters instead of what they are, thanks!Below is my SQL code that splits the string into the new table, any help on getting my strings to be put into new one that has a 20 character limit very appreciated!DECLARE @NextString NVARCHAR(200)DECLARE @Pos INTDECLARE @NextPos INTDECLARE @String NVARCHAR(200)DECLARE @Delimiter NVARCHAR(40)DECLARE @Position INTSET @Position = 0DECLARE @Results TABLE (Pos int, Label nvarchar(50), Label1 nvarchar(50), Label2 nvarchar(50), Label3 nvarchar(50), Label4 nvarchar(50))DECLARE @Label1 nvarchar(50)DECLARE @Label2 nvarchar(50)DECLARE @Label3 nvarchar(50)DECLARE @Label4 nvarchar(50)select @String = Notes from ELP_TC_DuctStub where ELP_TC_DuctStub_ID = '234'SET @Delimiter = ' 'SET @String = @String + @DelimiterSET @Pos = charindex(@Delimiter,@String)WHILE (@pos <> 0)BEGINSET @NextString = substring(@String,1,@Pos - 1)SET @Position = @Position +1insert into @Results(Pos, Label) values(@Position, @NextString) SET @String = substring(@String,@pos+1,len(@String))SET @pos = charindex(@Delimiter,@String)END -- Done Processing, labels split. Begin adding Label field back to Label1, Label2, Label3, Label4 -- set My_Counter to # of Words DECLARE @My_Counter INT SELECT @My_Counter = Count (*) from @Results -- set My Counter2 to 0 to begin using first word in Label field, then increment DECLARE @My_Counter2 INT SET @My_Counter2 = 1 DECLARE @My_Counter3 INT SET @My_Counter3 = 1 --begin loop through words (Label field) WHILE (@My_Counter >= 0) BEGIN DECLARE @Final_Word nvarchar(200) DECLARE @Word1 nvarchar(20) DECLARE @Word2 nvarchar(20) DECLARE @Word3 nvarchar(20) DECLARE @Word4 nvarchar(20) SET @Final_Word = '' WHILE (LEN(@Final_Word) < 20) begin SET @Final_Word = (SELECT Label from @Results where Pos = @My_Counter3) + ' ' + (SELECT Label from @Results where Pos = @My_Counter3 +1) SET @My_Counter3 = (@My_Counter3 +2) END --decrement/increment counters SET @My_Counter = (@My_Counter -1) SET @My_Counter2 = (@My_Counter2 +1) END--SELECT * from @Results