Link to home
Start Free TrialLog in
Avatar of andieje
andieje

asked on

The data types nvarchar and uniqueidentifier are incompatible in the add operator.

Hi

How do i use a variable of type uniqueidentifier in a string concatentation

Here is my line

SET @filter = @filter + '  J.EngineerID = ''' + @engineerID  + ''''
but i get this error
The data types nvarchar and uniqueidentifier are incompatible in the add operator.

thanks
andrea
Avatar of Aneesh
Aneesh
Flag of Canada image

u need to explicitly convert that unid variable


CAST(unid as varchar)
ASKER CERTIFIED SOLUTION
Avatar of Aneesh
Aneesh
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial