Monday, October 15, 2012

Operand type clash: int is incompatible with uniqueidentifier



When you get above error please double check following

- you are inserting into table from view
- table has column with data type - uniqueidentifier  with allow null
- view is returning null for uniqueidentifier field
- you have to convert null to uniqueidentifier field in view 

for example ,convert(uniqueidentifier,null) as MyUniqueIdentifierField  

1 comment:

Anonymous said...

Thanks for posting this solution. I'd been stuck on solving this for several hours before stumbling across this post, which fixed my issue straight away.