none
XML_NFE RRS feed

  • Pergunta

  • Bom dia!

    Estou tentando realizar uma consulta e não estou conseguindo. O caso é o seguinte:

    Tenho uma tabela no SQL SERVER chamada NF's.

    Dentre os campos desta tabela tem um chamado XML_NFE. Este campo esta configurado como TEXT.

    Meu problema é o seguinte, preciso realizar uma consulta retornando diversos campos deste XML.

    A estrutura deste XML é o de uma NFe.

    Segue em anexo um exemplo de XML.

    <?xml version="1.0" encoding="UTF-8"?><nfeProc xmlns="http://www.portalfiscal.inf.br/nfe" versao="2.00"><NFe xmlns="http://www.portalfiscal.inf.br/nfe"><infNFe versao="2.00" Id="NFe43120993424620002425550010000319071376926594"><ide><cUF>43</cUF><cNF>37692659</cNF><natOp>Remessa Venda Entrega Futura /</natOp><indPag>0</indPag><mod>55</mod><serie>1</serie><nNF>31907</nNF><dEmi>2012-09-27</dEmi><tpNF>1</tpNF><cMunFG>4320107</cMunFG><NFref><refNFe>43120893424620002425550010000311071432030000</refNFe></NFref><tpImp>1</tpImp><tpEmis>1</tpEmis><cDV>4</cDV><tpAmb>1</tpAmb><finNFe>1</finNFe><procEmi>0</procEmi><verProc>SAP NFE 2,00</verProc></ide><emit><CNPJ>93424620002425</CNPJ><xNome>ABCDEFGHIJ</xNome><enderEmit><xLgr>BR 386 KM 131</xLgr><nro>1179</nro><xBairro>Loteamento Tolotti</xBairro><cMun>4320107</cMun><xMun>Sarandi</xMun><UF>RS</UF><CEP>99560000</CEP><xPais>Brasil</xPais><fone>5433611813</fone></enderEmit><IE>1330054897</IE><CRT>3</CRT></emit><dest><CPF>60124016049</CPF><xNome>VALDIR PILONETTO</xNome><enderDest><xLgr>LINHA ARACA S/N</xLgr><nro>s/n</nro><xBairro>INTERIOR</xBairro><cMun>4316204</cMun><xMun>RONDINHA</xMun><UF>RS</UF><xPais>Brasil</xPais></enderDest><IE>2191031069</IE></dest><det nItem="1"><prod><cProd>000000000001000534</cProd><cEAN/><xProd>TOP MIX 02-18-18 - SC 50 KG</xProd><NCM>31052000</NCM><CFOP>5117</CFOP><uCom>TO</uCom><qCom>0.5000</qCom><vUnCom>1160.0000000000</vUnCom><vProd>580.00</vProd><cEANTrib/><uTrib>TO</uTrib><qTrib>0.5000</qTrib><vUnTrib>1160.0000000000</vUnTrib><indTot>1</indTot></prod><imposto><ICMS><ICMS40><orig>0</orig><CST>40</CST></ICMS40></ICMS><IPI><cEnq>999</cEnq><IPITrib><CST>99</CST><vBC>0.00</vBC><pIPI>0.00</pIPI><vIPI>0.00</vIPI></IPITrib></IPI><PIS><PISNT><CST>06</CST></PISNT></PIS><COFINS><COFINSNT><CST>06</CST></COFINSNT></COFINS></imposto><infAdProd>ICMS ISENTO CONFORME ART 9, INCISO IX,LETRA C DO RICMS-RS PIS/COFINS- Aliquota &amp;quot;0&amp;quot; conforme Lei 10.925 Art. 1o de 23/07/ Decreto 5.630 de 22/12/05.</infAdProd></det><total><ICMSTot><vBC>0.00</vBC><vICMS>0.00</vICMS><vBCST>0.00</vBCST><vST>0.00</vST><vProd>580.00</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0.00</vII><vIPI>0.00</vIPI><vPIS>0.00</vPIS><vCOFINS>0.00</vCOFINS><vOutro>0.00</vOutro><vNF>580.00</vNF></ICMSTot></total><transp><modFrete>0</modFrete><transporta><CPF>97368962004</CPF><xNome>FABIANO ZENI</xNome><IE>2181038737</IE><xEnder>RUA ANGELO RECH 700, APTO</xEnder><xMun>SARANDI</xMun><UF>RS</UF></transporta></transp></infNFe><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><Reference URI="#NFe43120993424620002425550010000319071376926594"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><DigestValue>HHjXjmf47FHMH2xwiCt3sylzRRg=</DigestValue></Reference></SignedInfo><SignatureValue>rEUWATbdWeGrGpck+l8RBSHWEJY5bDlLNL+XXtqeg2ICnCD03wLGYip8G1sW/CSsrZAYcU9MQVPvK0ntH+nXWOa7oKODZ7lZewLgM0jinu5C/9DY2F6+h44uVj+EsQk6hOw8pfIvMQ9pDF+vYRpj0phYyJRadeyEVd6/I4R6vR4FCTc4VDp0kmftY4TELAlPTVbNVIUbRo6smXiIKJ29JgT6qzN1pZ3s1Et1d4rBVWK/Je8BhvXw2/i3X9rcFUC5tXzjCzvnDLpuqRnFLwgc08krQBUSt0SGDegepTiyDxbCVmIoLemiK3rixBltS0Q7zvHPbNz6E/sRO2YxMXVNUw==</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIHzDCCBbSgAwIBAgIQMjAxMjA1MTYxNzQxNTQ3NTANBgkqhkiG9w0BAQsFADCBijELMAkGA1UEBhMCQlIxEzARBgNVBAoTCklDUC1CcmFzaWwxNjA0BgNVBAsTLVNlY3JldGFyaWEgZGEgUmVjZWl0YSBGZWRlcmFsIGRvIEJyYXNpbCAtIFJGQjEuMCwGA1UEAxMlQXV0b3JpZGFkZSBDZXJ0aWZpY2Fkb3JhIFNFUlBST1JGQiB2MzAeFw0xMjA1MTcxNDIxMDZaFw0xMzA1MTcxNDE3MzJaMIIBDDELMAkGA1UEBhMCQlIxEzARBgNVBAoTCklDUC1CcmFzaWwxNjA0BgNVBAsTLVNlY3JldGFyaWEgZGEgUmVjZWl0YSBGZWRlcmFsIGRvIEJyYXNpbCAtIFJGQjERMA8GA1UECxMIQ09SUkVJT1MxEzARBgNVBAsTCkFSQ09SUkVJT1MxFjAUBgNVBAsTDVJGQiBlLUNOUEogQTExGDAWBgNVBAcTD0VMRE9SQURPIERPIFNVTDELMAkGA1UECBMCUlMxSTBHBgNVBAMTQENPT1BFUkFUSVZBIERPUyBBR1JJQ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9hY3NlcnByb3JmYnYzLmNybDA1oDOgMYYvaHR0cDovL2NjZDIuc2VycHJvLmdvdi5ici9sY3IvYWNzZXJwcm9yZmJ2My5jcmwwRqBEoEKGQGh0dHA6Ly9yZXBvc2l0b3Jpby5pY3BicmFzaWwuZ292LmJyL2xjci9zZXJwcm8vYWNzZXJwcm9yZmJ2My5jcmwwTgYIKwYBBQUHAQEEQjBAMD4GCCsGAQUFBzAChjJodHRwOi8vY2NkLnNlcnByby5nb3YuYnIvY2FkZWlhcy9hY3NlcnByb3JmYnYzLnA3YjANBgkqhkiG9w0BAQsFAAOCAgEASRseLNMgCOftn9SJIRcBAWDh9H8cJMQLO6B9rRrDeWyeXeWElRQ5NLCc6Bb4Gf3k5g+QSR1j5uTN9S5mTSOI5gDu/72754noCjpvbg+0zcgV4nuY/QkU5GHNa6wwcsCXckDR+yFPu2dRrrlqpnuKLgWbLPo6a+XVClgzdDfm2i5WLtIbC8lXplpAJ7s1H6/LaClP4BTPxzp1IA78KhZIviX/EorDXx26caTCUmui2bI55IJGIDV8xnzgFnRlaRQMq72chRIR96CWTe+FdOvPGMmeuCo54x9oMjLnWY8pEi5QooR4XhUtPA5qS2QXurUlZtcDO/QGvQdxnjQxVD/Grt0zz3xHcpXN6ppomDW/HguigmdCdW2JS7GZsdQUHuHcS8v1zvV65Al7mMxxdHVT1tEUZD6gWog2HGDytQ0f4V1iWUb0MES/N6DGOo2mgGRII6HO+9GoiZcjTT9nvbsh26tASabX3144lP0N+7+XN1b92QFDip9PM5NUim5GcgUkRb6m12zJl7FJsAxfU/VHPJkyHYFoyfq+4wXt3VGZH9kXIDqoUpsydL+4vXwZGY1UKNYoutVJfqjjvzcdOsrNu0WT0l9dRA0DBLgupRGbjbV7L9PmA0lfiZh/M0v7PAkeSVCvRpxSVOqzwMLUuIxHAzl3DsgtQ0o/OOuOT52uKt0=</X509Certificate></X509Data></KeyInfo></Signature></NFe><protNFe versao="2.00" xmlns:n1="http://www.w3.org/2000/09/xmldsig#" xmlns="http://www.portalfiscal.inf.br/nfe"><infProt Id="ID143120132767324"><tpAmb>1</tpAmb><verAplic>RS20120801174240</verAplic><chNFe>43120993424620002425550010000319071376926594</chNFe><dhRecbto>2012-09-27T08:40:52</dhRecbto><nProt>143120132767324</nProt><digVal>HHjXjmf47FHMH2xwiCt3sylzRRg=</digVal><cStat>100</cStat><xMotivo>Autorizado o uso da NF-e</xMotivo></infProt></protNFe></nfeProc>   

    quarta-feira, 22 de janeiro de 2014 11:50