Exportar una sentencia sql a xml en disco
Tengo una consulta en sql2005 yo puedo crear el xml pero no puedo enviar el archivo creado a una ruta en disco. Agradecería su apoyo.
Esta es mi consulta que ya genera el xml pero no consigo enviarlo a disco y guardarlo.
select convert(decimal(7,6),dbo.FUNC_LONG(cast(r.georr_X as float),cast(r.georr_Y as float))) as lng ,
convert(decimal(8,6),dbo.FUNC_LAT(CAST(r.georr_X AS FLOAT),CAST(r.georr_Y as float))) as lat,
r.cod_recurso as id ,c.descrip_cast as tipo ,r.cod_cr_nivel1 as niv1 ,r.cod_cr_nivel2 as niv2 ,
r.cod_cr_nivel3 as niv3 , r.cod_cr_nivel4 as niv4 ,r.clase, r.nombre_cast as nombre ,
r.direc_sigla as sigla, r.direccion as dir1 ,r.direc_numero as num1 ,r.direc_resto as num2 ,
r.codigo_postal as cp ,r.localidad as locali , r.tfno1 ,r.tfno2 ,r.fax, r.e_mail ,
r.pagweb ,r.enlace_int1 as interes1,r.enlace_int1 as interes2,r.enlace_int3 as interes3,
r.numero_habit_localidad as habitantes, r.desc_cast as descr , r.observ_cast as observ,
fr.aloj_n_total_de_plazas as plazas
from (recursos as r left join categ_recursos as c on r.cod_cr_nivel1=c.cod_nivel1 and
r.cod_cr_nivel2=c.cod_nivel2 and r.cod_cr_nivel3=c.cod_nivel3 and
r.cod_cr_nivel4=c.cod_nivel4) left join ficha_resto as fr on
r.cod_recurso= fr.cod_recurso
where r.georr_x != 0 and r.georr_y != 0 and r.georr_x != 367315
and r.georr_y != 4727550
for xml raw('marker'), root ('markers')
Esta es mi consulta que ya genera el xml pero no consigo enviarlo a disco y guardarlo.
select convert(decimal(7,6),dbo.FUNC_LONG(cast(r.georr_X as float),cast(r.georr_Y as float))) as lng ,
convert(decimal(8,6),dbo.FUNC_LAT(CAST(r.georr_X AS FLOAT),CAST(r.georr_Y as float))) as lat,
r.cod_recurso as id ,c.descrip_cast as tipo ,r.cod_cr_nivel1 as niv1 ,r.cod_cr_nivel2 as niv2 ,
r.cod_cr_nivel3 as niv3 , r.cod_cr_nivel4 as niv4 ,r.clase, r.nombre_cast as nombre ,
r.direc_sigla as sigla, r.direccion as dir1 ,r.direc_numero as num1 ,r.direc_resto as num2 ,
r.codigo_postal as cp ,r.localidad as locali , r.tfno1 ,r.tfno2 ,r.fax, r.e_mail ,
r.pagweb ,r.enlace_int1 as interes1,r.enlace_int1 as interes2,r.enlace_int3 as interes3,
r.numero_habit_localidad as habitantes, r.desc_cast as descr , r.observ_cast as observ,
fr.aloj_n_total_de_plazas as plazas
from (recursos as r left join categ_recursos as c on r.cod_cr_nivel1=c.cod_nivel1 and
r.cod_cr_nivel2=c.cod_nivel2 and r.cod_cr_nivel3=c.cod_nivel3 and
r.cod_cr_nivel4=c.cod_nivel4) left join ficha_resto as fr on
r.cod_recurso= fr.cod_recurso
where r.georr_x != 0 and r.georr_y != 0 and r.georr_x != 367315
and r.georr_y != 4727550
for xml raw('marker'), root ('markers')
1 Respuesta
Respuesta de brownsea
1