SQL SERVER – FIX: ERROR: 8170 Insufficient result space to convert uniqueidentifier value to char

I just came across very simple error and the solution was even simpler. While concatenating NEWID to another varchar string, I had to CONVERT/CAST it to VARCHAR and I accidentally put length of VARCHAR to 10 instead of 36. It displayed following error.

Msg 8170, Level 16, State 2, Line 1
Insufficient result space to convert uniqueidentifier value to char.

Read More