Read XML data into SQL Server database - sql-server

I have created an Adobe LiveCycle form that collects the form data into an XML file. I would like to read this XML data into a SQL Server 2008 database. The format of the data is a parent table with 2 child tables. What are the options for getting the data into a database.

Your question is nearly identical to Importing data from XML file to SQL database.
You could try the 2008 version of the SQL Server Import/Export Wizard.
If you know how to write code, almost every programming language has a way to talk to a database and SQL server should be supported by all of them.

There are 2 ways read data from xml file For SQL Server 2008
1.Using xquery
2.Using OpenXML
How do you read XML column in SQL Server 2008?
Read XML document stored in SQL Server 2008 R2 with XML datatype
http://blog.sqlauthority.com/2009/02/13/sql-server-simple-example-of-reading-xml-file-using-t-sql/
http://blog.wharton.com.au/2011/05/27/part-2-openxml-what-is-it-and-how-do-i-use-it/

Related

Spatial Data Migration: from Oracle to SQL Server using SSMA

I'm migrating tables and views from Oracle to SQL Server using SSMA. I have a number of tables that have columns with SDO_GEOMETRY datatype, SQL Server does not work with that.
How could I map SDO_GEOMETRY to SQL Server? If it's not possible, then what should be done using SSMA?
And is it possible to work out this issue without editing anything in the Oracle database (just using SSMA or SQL Server)?
Oracle use an internal specific Oracle format of geo data that is non standard... Convert it to WKB or WKT and it should works.

How to export selective columns of multiple tables from SQL Server to one csv file?

In SQL Server (or SQL Server Data Tools) is there a way to export selective columns of multiple tables from SQL Server to one csv file?
The database is a Linked Server object connected in SQL Server connected ODBC.
Easiest way to do for a onetime deal: Copy-paste in Excel, and save that file in CSV.

How to store Excel sheet data in SQL Server database

I have a column that can accept only .xls sheet. And I want to know how how we can store from the uploaded file in SQL Server.
There are many different ways based on how you plan to access it once it's there. Here are the recommended ways from Microsoft (https://support.microsoft.com/en-us/kb/321686)
SQL Server Data Transformation Services (DTS)
Microsoft SQL Server 2005 Integration Services (SSIS)
SQL Server linked servers
SQL Server distributed queries
ActiveX Data Objects (ADO) and the Microsoft OLE DB Provider for SQL Server
ADO and the Microsoft OLE DB Provider for Jet 4.0
The techniques for each method are described in the article (or you can google them). If you just need to keep the file for download, you could just load the excel file into a VARBINARY column.
Depends on the database you will use, but generally binary files will be stored as BLOBs:
http://en.wikipedia.org/wiki/Binary_large_object
I recommend against doing this if you can avoid it though.

How to insert multiple records from Vb.net to SQL Server 2005 table?

I have 40000 records in my DataTable. I want to insert all the records into SQL Server.
I am using vb.net 2008 and SQL Server 2005.
Currently I am using XML to pass from vb.net to SQL Server 2005 but it will give me network error. Is there any other way I can achieve this ?
Look at the SqlBulkCopy class:
http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlbulkcopy.aspx

Get XML schema from database schema (SQL Server 2008 diagram)

Get XML schema from database schema (SQL Server 2008 diagram)
I am using SQL Server 2008. Is their is a way to do this in the SQL studio enterprise manager?
Rather than write code or use an external tool
SQL Server Management studio doesn't provide a way to do this.
Pasting the following into a code window gives you something close:
select * from INFORMATION_SCHEMA.COLUMNS for xml auto
Failing that, the answer is no, not without writing code or using an external tool.

Resources