Convert SQL Server Geometry to Elasticsearch Geoshape - sql-server

I'm writing an app to query spatial data from SQL Server and add the results to an Elasticsearch index.
Is there an effective method to convert SQL Server Geometry data (point, line, or polygon) to corresponding Elasticsearch Geo Shapes?

Related

Loading spatial data from SQL Server database into SPSS Modeler

Is there a way to load spatial data (column of type geometry) directly from a Microsoft SQL Server into SPSS Modeler via a database node as type geospatial? So far I only had success with shapefiles (i.e. flat files) or csv (allows parsing of square brackets as geospatial type) as input.
For some reason SPSS Modeler does not recognize the geometry type from the database. Workaround to load as WKT representation does only seem to work for Point geometries (i.e. to create geospatial data type/ list out of parsed x/y coordinate), also due to character field length limitation for wkt-representations of polygons.

How can I query the data stored in Azure Table Storage using T-SQL

We will be writing several hundred thousand rows of data to an Azure Table Storage Container. The data is made up of 4 columns, 1 of which contains a lot of JSON text which is the main column I'm interested in.
How can I query this data using T-SQL? I was hoping to join this with some existing data we currently hold in a table on SQL Server too.
I am new to Azure Storage and am trying to work out if I have to query the data directly or can I get it to my SQL Server to perform some more detailed querying? It is being stored on Azure to start with due to ease and cost.
Azure Table storage does not support SQL: https://db-engines.com/en/system/Microsoft+Azure+Table+Storage%3BMicrosoft+SQL+Server
If your store your data on blob storage you might be able to use Polybase to query data from your SQL Server https://learn.microsoft.com/en-us/sql/relational-databases/polybase/polybase-guide?view=sql-server-ver15

How to store data from MongoDB accessed by REST API in SQL-Server database as Table

I am newbie and needs guidance or resources to read. I have two databases, one is in Azure SQL-Server 2012 and the other is in MongoDB at remote location. I access the Azure SQL-Server data using Sql Server Management Studio (SSMS) from my PC and the data of Mongodb in browser using REST API. The retrieved data is in JSON format.
For analysis I want to merge the data from Mongodb in to SQL-Server. I don't know how to store the results of the REST API query as a table in SQL-Server 2012? Note that the columns I want to retrieve from MongoDB are not sub-structured so can easily fit in Relational database.
Azure SQL Database supports OPENJSON function that can parse JSON tet and transform it into a table see https://azure.microsoft.com/en-us/updates/public-preview-json-in-azure-sql-database/

Query Perfornance for querying XML Column in SQL Server

We are thinking of providing some advanced querying capabilities to application.
The application is in Retail domain and storing the core Entities in XML Column for all the main entities(Invoice, Order, Product etc) in the application.
The database is already > 10GB in size.
Will it be good choice to use query against XML Column in SQL Server, what are alternative to these as the core entity data is always stored as XML instead of RDBMS tables.

Import arbitrary XML to SQL Server

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.

Resources