DECLARE @x xml SET @x='' -- Following will not work -- SELECT @x.query('2 idiv 2') -- Workaround SELECT @x.query('xs:integer(2 div 3)') The resulting type from an arithmetic operator is based on the ...