How to import an xml file to sqlserver and also export from sql server to xml file.

  • Hi,

    my requirement is to import an xml file and map to the columns in an existing table in sql server. i mean i have to load the data, some times update from xml source to the sql server tables.

    i also need to export data from sql server to xml file all i need to this using ssis 2005.

    can anybody help me

  • As far as exporting to XML, that is fairly easy. Look at Books Online at the FOR XML clause.

    With regard to importing an XML file, you can use a DataFlow task with the XML file as the input and a SQL table as the destination. You can also just use a stored procedure using a variable to map to the location of the file and then use sp_preparexmldocument and sp_unpreparexmldocument stored procedures within your stored procedure.

    Hope that this helps...thanks.

    Chris

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply