I have a table like this .create table t1(id int,[timestamp] timestamp ) insert into t1 (id) values (1)insert into t1 (id) values (2)select * from t1id timestamp----------- ------------------1 0x0000000000570AA42 0x0000000000570AA5
AND I have to process the XML like this. DECLARE @l_xmlout INT, @l_xmlin XML set @l_xmlin = '<root> <subnode> <ID>1</ID> <Timestamp>0x0000000000570AA4</Timestamp> </subnode> <subnode> <ID>1</ID> <Timestamp>0x0000000000580AA4</Timestamp> </subnode> </root>' EXEC SP_XML_PREPAREDOCUMENT @l_xmlout OUTPUT, @l_xmlinselect XL.ID,XL.Timestamp from openxml(@l_xmlout,'/root/subnode',2 )with ( ID int, [Timestamp] timestamp -- varchar(100) )as XL join t1 on t1.ID = XL.ID -- and XL.Timestamp = t1.Timestamp --where t1.ID is nullEXEC SP_XML_REMOVEDOCUMENT @l_xmlout
In the above code I need to map the ID and TimeStamp from the XML to Table. If it fails I need the failed records.So my problem is when I use Time stamp in the with table it gives me new Timestamp so the comparision fails,So I get the time stamp to varchar but still I could not compare the records. I need the recors which doest matchRESULT SHOULD BE LIKE THIS.---------------------------ID TIMESTAMP1 0x0000000000580AA4
Because it fails from matching with the main table.Karthik