This is the normal bahavior of the datatype:create table t ( v int)insert into t select ''select * from tdrop table t
An empty string ("") is not nothing (NULL) and will be converted to the primitive datatype (if possible).DECLARE @idoc intDECLARE @doc varchar(1000)set @doc = '<ROOT><customer CustID="10" CustName ="mike" Age=""></customer><customer CustID="20" CustName ="james" Age="34"></customer></ROOT>'EXEC sp_xml_preparedocument @idoc OUTPUT, @doc INSERT INTO tblTest (CustID,CustName,Age)SELECT custid ,custname,case when age = '' then null else age endFROM OPENXML(@idoc, '/ROOT/customer') WITH (CustID INT,CustName VARCHAR(200),Age INT)EXEC sp_xml_removedocument @idoc