a table with the following data:
Sortcode Code Length abcd
I need to retrieve only the last character and update the code column with that character. I then need to update the length column with the length of the Sortcode column. I executed the following code and the code transformation was successful but I got nulls in the length column. Kindly suggest how I can resolve this.
update TempTable set code = right(Sortcode,1) where right(Sortcode,1) is not null GO SELECT leng = DATALENGTH(Sortcode), Sortcode FROM TempTable Update TempTable set ID = leng