I am looking at vendor page, and see contradicting information (top of each page with green or gray checkboxes) wheter XML column data type is supported in Azure SQL Server or not.
Could anybody with access to Azure SQL Server databases may tell me if XML is fully supported or not?
https://learn.microsoft.com/en-us/sql/connect/oledb/features/using-xml-data-types?view=sql-server-2017
https://learn.microsoft.com/en-us/sql/relational-databases/xml/xml-data-type-and-columns-sql-server?view=sql-server-2017
https://learn.microsoft.com/en-us/sql/t-sql/xml/xml-transact-sql?view=sql-server-2017
Just executed following script in Azure database, works fine:
create table x(t xml)
insert into x(t) values('<zz>aaaabbbb</zz>');
select t.value('/zz[1]','varchar(100)') from x;
Azure SQL database supports XML Data Type,xml (Transact-SQL) , but not supports XML data.
The documents which involve xml data all show don't support Azure SQL database.
I think XML is not fully supported in Azrue SQL Database.
But we can create XML data type column in Azure SQL database, and do what Piotr showed for you. Not all functions are supported in Azure.
Here is blog I think you can reference: How to load local XML File to Azure SQL Database?
There is a xml file and needs to be load into a table in an Azure SQL Database. The table has a column as xml type.
And it also gives you the answer maybe can give you some ideas about save XML fragments into fields.
Hope this helps.
Related
I have to move data from existing database oracle to which I don't have direct access. The data is about 11 tables, 5GB each. The database admin can export the tables to some .csv or xml. The problem with csv is that some data is textual with lots of special characters. The problem with xml is that the markup is an overhead which will increase significantly the size of the files. The DBA admin is not competent enough to provide a working and neat solution. He uses toad as the database tool. Can you provide some ideas how to perform such a migration in the best possible way?
Please refer the below steps to migrate the data from Oracle to SQL server.
Recommended Migration Process
To successfully migrate objects and data from Oracle databases to SQL Server, Azure SQL DB, or Azure SQL Data Warehouse, use the following process:
1.Create a new SSMA project.
2.After you create the project, you can set project conversion, migration, and type mapping options. For information about project settings, see Setting Project Options (OracleToSQL). For information about how to customize data type mappings, see Mapping Oracle and SQL Server Data Types (OracleToSQL).
3.Connect to the Oracle database server.
4.Connect to an instance of SQL Server.
5.Map Oracle database schemas to SQL Server database schemas.
6.Optionally, Create assessment reports to assess database objects for conversion and estimate the conversion time.
7.Convert Oracle database schemas into SQL Server schemas.
8.Load the converted database objects into SQL Server.
You can do this in one of the following ways:
* Save a script and run it in SQL Server.
* Synchronize the database objects.
9. Migrate data to SQL Server.
10.If necessary, update database applications.
For more details :
[https://learn.microsoft.com/en-us/sql/ssma/oracle/migrating-oracle-databases-to-sql-server-oracletosql?view=sql-server-2017]
After the admin export data into CSV, try to convert it into a character set which will recognize all special characters.
Then, try to follow the steps from this link: link, it might work.
If after the import, there are still special characters, thy to manually convert them.
Get the DBA to export the tables using the ASCII delimiters which were designed for this purpose:
Row delimiter: Decimal 30 / 0x1E
Column delimiter: Decimal 31 / 0x1F
Then you can use BCP (or any other similar product) to upload the data to SQL Server.
I was trying to change the data type into XML in order to split one column into multiple columns. However, when I ran the syntax below, an error: cannot find data type XML was showed. I searched some of the answers online. It seems Azure is supported for XML. Is there a way to solve it?
cast('<m>'+replace(Employee_Name,#delimiter,'</m><m>')+'</m>' as XML)
Besides, I found that IDENTITY(1,1) is not supported either.
With SQL-Server 2016 there is native support for this: STRING_SPLIT()-function. But - according to the linked doumentation - this seems not to be offered for Azure Data Warehouse...
The string splitting via XML needs the XML-DataType, since you will need .nodes() and .value() to retrieve the values. According to this documentation this is supported with Azure Database, don't know of restriction with the Data Warehouse version...
There are many examples for string splitting functions using loops or recursive CTEs. This article compares some of them...
This error occurs when you try to run the query casting to XML while logged into a Microsoft Azure SQL Data Warehouse. Azure SQL Data Warehouse does not support the XML datatype. You can confirm your version with the following sql:
select ##version
https://learn.microsoft.com/en-us/azure/sql-data-warehouse/sql-data-warehouse-tables-data-types
I want to do simple transformation with source as Flat file and target as SQL Data Warehouse.In target Analyser using ODBC Connection I am able to connect the SQL Data Warehouse and connection is successful,but no tables are listed and I am unable to select a table to import.(Sample Tables are created in SQL Data warehouse)
Whether it is possible to create a Source/target as SQL Data warehouse?If so kindly help me to solve the issue.
Thanks & Regards
Prakash
Informatica does offer support for Azure SQL Data Warehouse and are listed as a Partner solution https://azure.microsoft.com/en-gb/documentation/articles/sql-data-warehouse-integrate-solution-partners/
Here is a link to all the configuration required for Informatica Cloud for example: https://kb.informatica.com/proddocs/Product%20Documentation/5/IC_Winter2016_MicrosoftAzureSQLDataWarehouseConnectorGuide_en.pdf
What version are you using Prakash?
If you are trying to select data from SQLDW I would also check that your connection is targeting the specific database you have created. You could be connecting to the master db on the logical server rather than the sqldw database itself.
Is that possible to parse and import an arbitrary XML file to SQL Server tables using C#?
The XML file can be highly hierarchical.
I have 1 Gb XML-file, I do not know anything about it.
How can I determine what tables it contains, create them at SQL Server and bulk load the data to SQL Server?
Is that possible?
No.
XML and SQL are very, very different things. It is possible to take SQL data an save it into XML, and such SQL-like XML can be converted back to an SQL database, but arbitrary XML that did not originate in an SQL-like system is not likely to be easily convertible to an SQL database schema in any meaningful way.
You could work out an SQL schema that represents generic XML in a key-value type design but it would not be an SQL schema in the traditional meaning of the word.
I have an old SQL Server 2000 database that I want to get into XML so I can from there import parts of it into an SQLite database for a PHP website.
I've accessed the SQL Server 2000 database via SQL Server Management Studio 2008 Express, I can open all the tables, view the data, etc.
I was expecting to be able to e.g. right-click on "Tables" and select "Export all tables to XML" but cannot find any export feature like this.
What is the easiest way to export this SQL Server database to XML files, I don't even need the schema (int, varchar, etc.), just the data.
SELECT * FROM {tablename} FOR XML AUTO
is working fine in this particular case, thanks ogiboho via twitter
You could write a .NET app that retrieves the tables to a dataset and then get the XML from the dataset...
http://msdn.microsoft.com/en-us/library/zx8h06sz.aspx
Alternatively you could look at this forum post, it has lots of different ways to approach achieving this...
http://sqlxml.org/faqs.aspx?faq=29