How to shred and import XML into SQL Server from the
Command Line
Easily import XML data into an SQL Server database
from the command line.
In addition to making it very easy to shred and import XML
data into SQL Server with a Wizard
interface, Exult SQL Server also
includes a command line interface using which you can create batch
jobs to import the XML. This HOWTO takes you through the steps to
accomplish the task after.
-
The command line interface to Exult SQL Server is
called Exultcmd.exe and is installed in the same
location as Exultsql.exe. Executing the program without
any arguments or options shows the full usage syntax.
-
The syntax for importing one or more XML files into SQL Server is as
follows:
Exultcmd.exe ConnectionString InputXMLFile
-
For specifying a connection to SQL Server, use one of the forms shown
below:
- Host@: connect to default database on the default instance
on the specified Host.
- Host@Database: connect to specified Database on the
default instance on the specified Host.
- Host\Instance@: connect to the default database on the
specified Instance on the specified Host.
- Host\Instance@Database: connect to
specified Database on the specified Instance on the
specified Host.
- Host\Instance,Port@Database: Specify the Port number
to connect to. This is the complete syntax for specifying a
connection string.
-
Note: To list the available instances and databases on a
specified host, run this command on the server where SQL Server is
installed. This command looks inside the Windows Registry to get the
instance information.
Exultcmd.exe -L
-
To use Windows Authentication to connect to SQL Server, you should not
specify a username or a password.
-
Specifying a username and a password uses SQL Server authentication to
connect to SQL Server.
-
Specify the XML file to be imported into SQL Server after the
connection string.
-
To import multiple XML files, just specify the list
of files one after another. You could also specify a wildcard such
as *.xml
-
You could also specify a wildcard such as *.xml
-
Importing the XML into SQL Server. If the files are large, the
processing could take some time. Hit CTRL-BREAK to abort the
import.
See Also
Create Pivot Tables and Pivot Charts from Large Datasets.
Query & extract XML data into Microsoft Excel
(XLS), Microsoft Access (MDB or ACCDB), or CSV.
Convert XML into Microsoft Excel (XLS), Microsoft Access (MDB or
ACCDB), or CSV.
Shred and import XML into SQL Server.
Import XML data into automatically created MySQL
tables.