2
I have a table that stores an XML in one of its columns, but I need to make a select by placing each XML item in a column. The problem is that I don’t want to create another table, I want something, even if it’s temporary, just to make it easier to access the data.
Example:
<?xml version="1.0" encoding="utf-16"?>
<Viagem xmlns:xsd="http://www.w3.org/2001/XMLSchema" mlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <Identificador>111111</Identificador>
   <EstimativaInicio>2015-09-07T23:46:48</EstimativaInicio>
   <EstimativaFim>2015-09-07T23:46:48</EstimativaFim>
   <IdCliente>000</IdCliente>
   <IdEmbarcador>000</IdEmbarcador>
   <IdUnidade xsi:nil="true" />
   <CNPJUnidade>00000000/0000-00</CNPJUnidade>
   <IdCooperativa xsi:nil="true" />
   <IdTransportadora xsi:nil="true" />
   <TemperaturaMinima>0</TemperaturaMinima>
   <TemperaturaMaxima>0</TemperaturaMaxima>
   <Motorista>JOAO DA SILVA</Motorista>
   <Placa>ITO-7457</Placa>
   <FoneMotorista>0000000000</FoneMotorista>
   <Tipo>AAA</Tipo>
   <Peso>0</Peso>
   <Valor>0</Valor>
   <Cubagem>0</Cubagem>
   <ViagemPrioritaria>1</ViagemPrioritaria>
   <Entregas>
       <Entrega>
           <Sequencia>2</Sequencia>
           <Codigo>000000000/0000-00</Codigo>
           <Referencia>AA COMERCIAL DE ALIMENTOS LTDA</Referencia>
           <Latitude>-00.0000</Latitude>
           <Longitude>-00.0000</Longitude>
           <EstimativaInicio>2015-09-07T00:00:00</EstimativaInicio>
           <EstimativaFim>2015-09-07T10:06:00</EstimativaFim>
           <Peso>28.06</Peso>
           <Cubagem>0</Cubagem>
           <Valor>201.34</Valor>
           <Endereco>RUA, 000</Endereco>
           <Bairro>CENTRO</Bairro>
           <Cidade>CIDADE</Cidade>
       </Entrega>
   </Entregas>
</Viagem>
This XML above should return me a table with the following columns:
- Identifier;
 - Estimativainicio;
 - Estimation;
 - Idcliente;
 - Money-grabber;
 - Cnpjunidade;
 - Temperaturaminima;
 - Temperaturamaxima;
 - Chauffeur;
 - Plaque;
 - Speech therapist;
 - Type;
 - Heaviness;
 - Valor;
 - Vatage; and
 - Roundtrip.
 
The columns of the Deliveries tag should be ignored as it will not be used at this time.
Someone knows how to do this?
What is the bank’s technology?
– Leonel Sanches da Silva
@Ciganomorrisonmendez Working with SQL Server
– Isa