Create Table in Azure SQL Server for mobile services (.net Backend) - azure-sql-database

I am creating table in Azure SQL Server using mobile services webservice (.net backend). But table is not created in SQL Server.
My questions are:
Can I create table manually in Azure SQL Server?
If I can create table then there will any possibility of error?
Is there any possibility to find out why table is not creating?
Please provide your suggestions how to solve this

If you are using the .NET backend, you are operating in Entity Framework for table management. You will likely need to do an EF Migration to create the table - there is no dynamic schema / table maintenance. It's best to learn Entity Framework and go from there.
Specifically:
1) Yes, you can create the table manually in the SQL Management Studio.
2) You will need to define the appropriate table within your .NET backend as well. The schema must match what is expected. You can't just take any old table and expect it to work
3) You can turn on logging in the Entity Framework and see the underlying SQL statements and errors being returned by SQL Server. However, your problem is likely to be because Entity Framework hasn't run a migration.

Thanks for your answer.
Table has created by using mobile services.
Actually table has been created by using mobile services but it was not displaying in sql server. To display table in sqlserver i have to do action (like insert,update data) in atleast one table. then all table display.

Yes you can. If you use Mobile Services, go to the dashboard and Configure - here, you will see the database server link. Go to that, and get the connection string. Then, you can connect with something like, for example, SQL Server Management Studio 2014 (i would recommend to do that to avoid any support inconsistencies) and do what you want with the database (with some limitations, however). You may do that using Visual Studio as well.
If you use Mobile Apps, go to the Mobile App dashboard, then Data Connections - here, you will see the hidden connection string that you can use for connecting the same way as described above.

Related

SQL Server database table to oracle server using WebAPI [scheduled]

I have an application which is build recently and pushes data into SQL Server.
And I have another application which uses an Oracle database and gets data manually so far.
Now I need a way how I can insert the data that comes into SQL Server into Oracle daily.
Is there a way to do this with Web API in combination with schedulers?
Customer wants this to be done with Web API with some scheduling. I'm not sure how it can be done.
Any help will be highly appreciated.
Thanks

How to get/set information in an SQL database via internet connection

I'm currently creating an SQL database that will eventually be accessed by web applications, both mobile and desktop platforms.
Setting up the SQL database is easy.
What I'm currently having trouble with is how I'm going to allow clients to access to information in the database without having direct access to the database, for security purposes.
For example, let's say I have a list of employees, and I'm creating employee profiles for a mobile application. I would like for the mobile application to be able to use a function such as get(employee_name), which will call the database and retrieve the information about the employee in the form of a JSON.
How would I go about doing this?
To see a very nice solution on using JSON on sql server tables please look at Phil Factors article Consuming JSON Strings in SQL Server at:
https://www.simple-talk.com/sql/t-sql-programming/consuming-json-strings-in-sql-server/

Azure Create Database In Code

I have a prototype paas (platform as a service). The solution currently saves data for all customers in a single sql instance. For now this is fine, but I worry about slowdowns when the db grows. I reason I could keep the service running fast if each customer had their own database.
I was looking on the Azure portal and I found nothing. I can easily create a new database manually - but - I don't want that, I want to keep everything automated. Is there a way I can setup a sql server 'group' ?
While I am at it, SQL is not a requirement. My data is noSQL ready. Is this something I could do with monogoDB running on a worker role ? me.
You should look at the Azure DocumentDb preview, which is a NoSQL database provided as a managed service.
There is a Azure SQL Managment Nuget
http://www.nuget.org/packages/Microsoft.WindowsAzure.Management.Sql
http://www.bradygaster.com/post/managing-windows-azure-sql-databases-using-the-management-libraries-for-net

SQL synchronize database between local and remote server

I've got 2 companies in different locations and the main server is at my office. The main server is working with a full version of SQL Server where the companies use SQL Server express version.
What is the best way to synchronize these SQL Server databases together that the main server have always the latest updates?
There are several technologies specifically for this type of scenario:
SQL Replication
Supports unidirectional or bidirectional synchronization
SSIS
Lets you define the mappings of the data, as well as transformations, and attach other code to the process easily
Linked-servers
Allows you to query databases and tables on remote servers as though they are part of the local database. Very easy to setup (just call exec sp_addlinkedserver) and once defined uses nothing but plain old SQL
If you want to do in an event (like button click), I would suggest Linked Server. Click here for a simple tutorial about how to create a linked server. After creating linked server, we can query it as follows:
select * from LinkedServerName.DatabaseName.SchemaName.TableName

How to automatically push data from SQL Server to Oracle?

I have users entering data in SharePoint (Running on SQL Server), but my application to view that data will be an Oracle Apex app running on Oracle, obviously. How do I have the data be pushed into the Oracle db automatically?
First off, are you sure that you need to replicate the data to Oracle? Oracle Heterogeneous Services allows you to create a database link in Oracle that connects to a non-Oracle database using ODBC (assuming you use the Transparent Gateway for ODBC which is free). Your APEX application could then query and report on data that is in SQL Server by issuing queries that run over the database link. Tim Hall has a good article (though it's a bit dated and some of the components have been renamed, the general approach is still the same) on configuring Heterogeneous Services.
If you do need to replicate the data, you can create materialized views in Oracle that query the objects in SQL Server using the database link you created with Heterogeneous Services and schedule those materialized views to refresh on a regular basis. The materialized views will need to do a complete refresh, though, which means that every row will need to be copied from SQL Server to Oracle every time there is a refresh. That generally limits the frequency with which you can realistically have refreshes happen. If you need the data to be replicated to the Oracle database and you need to send incremental changes so that the Oracle side doesn't lag too far behind, you can use Streams from a non-Oracle database to an Oracle database but that involves a lot more work.
In SQL Server you can setup linked servers that allow you to view data from other db's. You might see if Oracle has something similar, if not the same. Alternatively, you could use the sql's integration services to push the data over to an oracle table. Unfortunately I only know how to setup linked servers in SQL Server and I don't have a lot of experience with ssis to tell you how to do that, but those are the first two options I can think of that you might explore further.
Here's a link I found that might be helpful as well: http://www.dba-oracle.com/t_connecting_sql_server_oracle.htm
There's no way to do it "automatically" that I know of that will work across DBMS. ETL tools like Sql Server Integration Services might help but there's going to be a loading delay (as it will have to poll for changes). You could build some update triggers on the SharePoint database tables but that's going to turn into a support nightmare.