Msg 206, Level 16, State 2, Line 6 Operand type clash: int is incompatible with xml

Posted on : 11-05-2012 | By : Devi Prasad | In : SQL Errors, XML

Share:

0


Error:

Msg 206, Level 16, State 2, Line 6
Operand type clash: int is incompatible with xml

This error comes up when you try to set XML variable with an int value.

Sample Code:

DECLARE @Var1 XML
DECLARE @Var2 INT

SET @Var2 = 1

SELECT @Var1 = @Var2

When you execute the above code you get this error at line 6
SELECT @Var1 = @Var2

Fix:
Check all the XML related variables, columns in the table, Arguments to stored procedure, function etc…
and validate if the correct XML value is set.

Applicable to SQL Server 2000,SQL Server 2005,SQL Server 2008,SQL Server 2008 r2,SQL Server 2012, SSIS

(Visited 1,463 times, 1 visits today)



References : Devi Prasad (sqlserverlearner.com)

Need Help On SQL Server?

Cannot Find Solution to your problem (or) If you are looking for some help on SQL Server. Dont worry Click Here to Post your question and solve your issue.


Do you like my blog?

If you liked reading this blog, please help spread the word by sharing this blog with your friends.




Write a comment



Tags: