I'm trying to assemble an insert statement inside a stored procedure:
The value of @move_guid is equal to the output of newid()
The procedure can compile without errors, but when I try to run it, I get:
Arithmetic overflow error converting expression to data type nvarchar.
How do I concatenate a uniqueidentifier into a string?
DECLARE @cmd nvarchar(max)
set @cmd='select * from move_request where guid=''' + cast(@move_guid as nvarchar) + ''' and completed=1'