Jul 12, 2019 01:40 PM|limno|LINK
Always to remember to assign a size to your data type instead of using its default. In your code, the default site of nchar is 30, which is shorter that the length of uniqueidentifier type (36).
Add a size to nchar should work for you.
set tempid = left(cast(secondaryID as nchar(36)),5)
where meid >= 0