Converting SQL table data to JSON automatically - sql

I am looking to have my data in JSON format from SQL server database.Is there any API available for it ? Basically I need it for demo purposes only.
Some thing like this Looks relevant but again I am not sure how is that being used here. I have apache installed.
Can I get some directions on it or may be some other API relatively easier to use ?

A Web API might be a good choice. I recommend using the Database First approach if you already had the Database: http://www.asp.net/web-api/overview/data/using-web-api-with-entity-framework/part-1.
Well, a better tutorial can be found here: http://tomislavbabicnet.blogspot.com/2013/03/build-application-using-aspnet-mvc-4.html

You can try doing it in the sqlserver.
Go through this link. It will solve the purpose.

Related

Set up parse server for parse livequery

Does anyone have any introductory level walkthrough on how to set up a parse live-query? Do I just grab the latest version on github and it should have everything pre-set? I'm not sure where to start.
there are many answers out there regarding the same question. However, i am just gonna give a brief how-to here.
Firstly, you can use download the parse server from this github.
In the index.js, if you read through it you should find something like
liveQuery: {
classNames: ["Posts", "Comments"] // List of classes to support for query subscriptions
}
the classnames "Posts" and "Comments" are basically your database table names. I believe you are using mongoDB for your database right?
After which, once you upload the parse server to AWS/heroku, you should be ready to use live query.
On the client side, you just need to subscribe to table names you did at your server side and you are good to go.

Fake mysql server to run sql commands on for practice

I am trying to get better with SQL commands, but I really do not have a database currently set up that I can practice on. Does anyone know of an all-in-one program or an online service that has a database set up and filled with data that I could practice my SQL commands on/in?
Frankly, I do not really know of any GOOD online site for doing this.
Google gave me this site but i tried it out and its really a bit cumbersome and difficult to work with.
I would really suggest that you will find it a LOT easier to install some database like MySQL / SQL Server Express on your machine and try things out.
Installing something like SQL Server Express is really easy. You can just download the db + tools from here, a quick install and you will be all set to go
For the sample data, you can always download the Adventureworks database.
Step by step details on how to get the AdventureWorks database running with SQL Express are listed here
Google's your friend
http://www.mysqltutorial.org/mysql-sample-database.aspx
I found this site pretty much helping.
http://sqlzoo.net/wiki/SELECT_basics
Although they use mariaDB still same queries.. So no worries.

querying database in android

I am building an android app and I have an SQL database stored on a server. I need to either pull the database into android or query the database and have it return information from the tables. I have searched all over the internet but I haven't found anything that explains how to connect to the server from android. How can I do this?
You can't query database in a server from android directly. You have to write PHP scripts to query database from server. You have to keep the php scripts in a web server. And from android application you have to get the data from the php page.
I don't think there is a reasonably simple way to 'pull' the database or connect to it using some soft of ODBC connection. And I don't think it would be wise to use it even if possible.
I believe the best way to solve your problem would be to implement some sort of REST API interface to your database and fetch data as needed.
actually, despite gypsicoder's answer and several "how to"s on the internet, there is a way to connect/query an SQL database from android
you just have to download the corresponding JDCB. for mysql: http://dev.mysql.com/usingmysql/java/
then you just use the java.sql interfaces/classes to do stuff (mysql has a reference manual at above link)

Django convert Model to sql code

My plan is to be able to dynamically generate SQL tables. Since I know django can create SQL tables using models, they must have a function for this. The problem is I can not find this function in the Django folder, or maybe I simply don't recognize it.
thnx
It's called django-admin.py
Start here: http://docs.djangoproject.com/en/dev/ref/django-admin/
Specifically, see http://docs.djangoproject.com/en/dev/ref/django-admin/#django-admin-sql
I am not exactly sure what you mean, but you can get the SQL for all the tables in an app by running this command:
python manage.py sqlall your_app
If you're looking for the specific pieces of code, have a look at django.db.backends.base.creation to see how the sql is generated, of course there need to be individual implementations for different database types, so for example also see django.db.backends.postgresql_psycopg2.creation!

How to test if a SQL Server 2008 database can serve 200 concurent users

I have a SQL Server 2008 database in 3NF.
I must check if the db can support many concurent users.
Which is the best method ?
Is there any free tool to do this ?
Thank you very much.
SQLQueryStress - http://www.datamanipulation.net/SQLQueryStress/documentation/documentation.asp
and
SQLStress - http://www.sqlstress.com/Overview.aspx
Both look like a good fit for what you want to do.
The database design and the queries you run against it are vital; no generic answer can be reliable.
I recommend you start with the MS SQL community's benchmark tools.
Since uses are hopefully not accessing the database directly you must have some front end, that is where I would perform my load test. You can use TFS to do load tests as well as Selenium.
Assuming that you have created some kind of web front end that queries your database, then the excellent open source tool Sahi would really help you out. The test toolkit allows you to simulate multiple users using your website - and therefore your database.