use OPENXMLhttp://msdn.microsoft.com/en-us/library/ms186918.aspxsomething likeDECLARE @idoc int, @doc varchar(1000); SET @doc ='<batch><job id="100360001"><cycle_no type="string">36</cycle_no> <PDM type="string">C</PDM> </job><job id="100360002"><cycle_no type="string">36</cycle_no> <PDM type="string">C</PDM></job></batch>'; --Create an internal representation of the XML document.EXEC sp_xml_preparedocument @idoc OUTPUT, @doc; INSERT temp (id,cycle_no,pdm)SELECT *FROM OPENXML (@idoc, '/batch/job',2) WITH (ID int '@id', cycle_no varchar(36) './cycle_no', pdm varchar(1) './PDM');EXEC sp_xml_removedocument @idoc;
------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs