Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Erland Sommarskog Newsgroups: comp.databases.ms-sqlserver Subject: Re: Help for XML data type in ms-sqlserver Date: Mon, 09 Apr 2012 23:31:16 +0200 Organization: Erland Sommarskog Lines: 25 Message-ID: References: <19738bce-58dd-477f-a1f2-a87edd2064b7@p6g2000yqi.googlegroups.com> <08cbb43e-4193-4305-b6b2-a1a1320ab65b@w17g2000yqe.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Injection-Info: mx04.eternal-september.org; posting-host="nBFDv6s1VJQDuF1w6hpX2A"; logging-data="1344"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/0rqIH5TxS1wG9B7A7DaRd" User-Agent: Xnews/2006.08.24 Mime-proxy/2.1.c.0 (Win32) Cancel-Lock: sha1:j8gNlkDf3eTGbkyOnwKMxdkST94= Xref: csiph.com comp.databases.ms-sqlserver:965 Ender Karada? (enkaradag@gmail.com) writes: > actually ive already done something like that before ive written that > post. (using OPENXML) OPENXML is legacy, although it has to be admitted that it sometimes performs better than the newer xml type methods. But since the type methods does not require the call to sp_xml_prepare/removedocument, I prefer them over OPENXML. > 1) .... where/on xxx.DOCUMENTNO=yyy.DOCUMENTNO disturbs me /i dont > know why/ > > 2) my actual purpose here is; what if our xml contains more than one > invoice data? Guess what? My solution is aimed to handle that situation. And that's why get this join that disturbs you. Try it! -- Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se Links for SQL Server Books Online: SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx