Switching Fusion Tables to SQL Server Google Maps - sql

We have been working on some of the database in CSV format and putting them into Google Fusion Tables. But, now is it possible if we can SQL Server to get the data from the database and output a layer with markers to the user.
We want to avoid ASP.NET and C# if possible. We would prefer JS And PHP, but can't seem to find much help regarding the matter.
Does anyone have input on using SQL Server with Google Maps to plot points based on data in the DB?

I think what you could do is write a PHP file that queries SQL Server and returns a JSON array. You could then use JS to plot your map points.
Take a look at this blog post: SQL Server JSON to Table and Table to JSON.
It talks about SQL Server to JSON. They are using it with PowerShell, but one could use it as a starting point for PHP.

Related

Conversion of JSON to Presto based SQL Query

I am creating a web app in which there is an analytical dashboard that is allowed to generate a query. This query will be forward to backend server through an exposed API. The controller (written in Node.js) behind this API will execute this query on AWS Athena to fetch the required data.
Now the problem is that how should I send query to backend server. Should I use JSON format? Then at backend How should I convert JSON to SQL Query? Do I need to write custom solution or is there any supported library available?
Is there any better way of doing this?
I have tried some JavaScript libraries like JSON-SQL, JSON-SQL-Builder2 but these doesn't support the format of Query that will be executed by Athena. Athena uses Presto engine to run a query.
Good evening,
If your problem is sending a query to the database from Node, then it seems like the AWS SDK for JavaScript in Node.js.
Your workflow will likely be something like:
Start Query Execution
Get Query Execution
Get Data from S3

Convert an online JSON set of files to a relational DB (SQL Server, MySQL, SQLITE)

I'm using a tool called Teamwork to manage my team's projects.
The have an online API that consists of JSON files that are accessible with authorisation
https://developer.teamwork.com/projects/introduction/welcome-to-the-teamwork-projects-api
I would like to be able to convert this online data to an sql db so i can create custom reports for my management.
I can't seem to find anything ready to do that.
I need a strategy to do this..
If you know how to program, this should be pretty straightforward.
In Python, for example, you could:
Come up with a SQL schema that maps to the JSON data objects you want to store. Create it in a database of your choice.
Use the Requests library to download the JSON resources, if you don't already have them on your system.
Convert each JSON resource to a python data structure using json.loads.
Connect to your database server using the appropriate Python library for your database. e.g., PyMySQL.
Iterate over the python data, inserting rows into the database as appropriate. This is essentially the JSON-to-Tables mapping from step 1 made procedural.
If you are not looking to do this in code, you should be able to use an open-source ETL tool to do this transformation. At LinkedIn a coworker of mine used to use Talend Data Integration for solid ETL work of a very similar nature (JSON to SQL). He was very fond of it and I respected his opinion, so I figured I should mention it, although I have zero experience of it myself.

How to display SQL data in Wordpress?

Does Wordpress has an ORM? How do you access data from an SQL server like MySQL and display it in Wordpress?
The best practice to interact with data in WordPress is using WordPress API, so you don't worry the compatible issue.
If you want to query the data by using SQL syntax, you can use wpdb.

Using SQLServer to query elasticSearch data

In my use case, ElasticSearch is already configured and has data that can be queried via REST API. I'm wondering if there is a way to write SQL statements that can query this data that ElasticSearch is already configured on.
Example, configure an adapter to ElasticSearch in MS SQLServer and use linkedserver to connect and run normal SQL statements.
I have read about the "river", but it seems to do the opposite of what I'm looking for. Any pointers will really help.
SQL Server is a relational database. It operates with tables in common. Posting requests to some URI is very unusual work for SQL Server. And there is no standard mechanism to do this.
What can you do:
Write a CLR-function to send post-requests
Map result json to some table (it can be difficult, because Elastic Search is document-oriented and SQL Server is not)
So, as for me, this way is very complicated. I advice to use some hand-written service to operate with DB and Elastic Search, and don't try to put all logic to SQL Server.
Something like Elasticsearch-SQL plugin might be of interest to you.
This won't allow you to use it as a linked server in MSSQL, but it will allow whatever application you have, to send SQL queries to the sql API on your ElasticSearch server and get results.
Example:
http://localhost:9200/_sql?sql=select * from indexName limit 10

Sql Server Full Text Search - Getting word occurances/location in text?

Suppose I have Sql Server (2005/2008) create an index from one of my tables.
I wish to use my own custom search engine (a little more tuned to my needs than Full Text Search).
In order to use it however, I need Sql Server to provide me the word positions and other data required by the search engine.
Is there anyway to query the "index" for this data instead of just getting search results?
Thanks
Roey
No. And if you could, what happens if Microsoft decide to change their internal data structures? Your code would break.
What are you trying to achieve?
You shouldnt rely on SQL servers internal data structures - they are tailored specifically for SQL servers use and aren't acessible for querying anyway.
If you want a fast indexer then you will probably have more success using a pre-written one rather than trying to write your own. Give Lucene.Net a try.