Exportar una tabla de SQL a un archivo XML
Publicado por Edna (1 intervención) el 20/11/2008 16:17:55
Hola ,
Necesito exportar una tabla de SQL a un archivo XML por medio de un query. Encontre un documento que dice que el stored procedure de abajo sirve para eso: Sp_makewebtask
@outputfile , @query , @templateFile
Pero cree mi archivo template de prueba y me marca error no se si hay otra forma de hacerlo o que estoy haciendo mal.
Espero tu ayuda.
Archivo Template:
-------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8" ?>
<install-config>
<product><%insert_data_here%></product>
<layout><%insert_data_here%></layout>
</install-config>
-------------------------------------------------------------------------
SQL comado
----------------------------------------------------------------------------
Declare @outputfile nvarchar ( 255 );
Declare @query nvarchar ( 2000 );
Declare @templatefile nvarchar ( 255 );
set @outputfile = "c: empFichero.xml" ;
Set @query = "SELECT [firstName],[lastName] FROM [CEDB].[CIQ].E2E_CIQ_User] WHERE [UserID]=""5095316" ;
Set @templatefile = "C: emp est.tpl" ;
Exec sp_makewebtask @outputfile , @query , @templateFile
----------------------------------------------------------------------
Me genera el siguiente error:
Msg 8114, Level 16, State 5, Procedure sp_makewebtask, Line 0
Error converting data type nvarchar to tinyint.
Mi correo es [email protected] , espero puedas ayudarme gracias!!!!
Necesito exportar una tabla de SQL a un archivo XML por medio de un query. Encontre un documento que dice que el stored procedure de abajo sirve para eso: Sp_makewebtask
@outputfile , @query , @templateFile
Pero cree mi archivo template de prueba y me marca error no se si hay otra forma de hacerlo o que estoy haciendo mal.
Espero tu ayuda.
Archivo Template:
-------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8" ?>
<install-config>
<product><%insert_data_here%></product>
<layout><%insert_data_here%></layout>
</install-config>
-------------------------------------------------------------------------
SQL comado
----------------------------------------------------------------------------
Declare @outputfile nvarchar ( 255 );
Declare @query nvarchar ( 2000 );
Declare @templatefile nvarchar ( 255 );
set @outputfile = "c: empFichero.xml" ;
Set @query = "SELECT [firstName],[lastName] FROM [CEDB].[CIQ].E2E_CIQ_User] WHERE [UserID]=""5095316" ;
Set @templatefile = "C: emp est.tpl" ;
Exec sp_makewebtask @outputfile , @query , @templateFile
----------------------------------------------------------------------
Me genera el siguiente error:
Msg 8114, Level 16, State 5, Procedure sp_makewebtask, Line 0
Error converting data type nvarchar to tinyint.
Mi correo es [email protected] , espero puedas ayudarme gracias!!!!
Valora esta pregunta


0