I have an on-premise SQL Server and I want to access the data from Azure WEB APP so the best solution found is creating a view on the on-premise server and setup transnational replication only on that view to Azure SQL.
I've set up the replication and I keep getting this error:
Reference to database and/or server name in '..' is not supported in this version of SQL Server
I think the problem is that the view is replicated as a command (CREATE VIEW ...) and not as raw data.
The SQL Server is the publisher, and the there is no way to expose any internal network ports.
Is there a way to replicate the view as raw data and not indexed?
Transnational Replication replicates views, but just the view definition. You have to either replicate the base tables, or make the view an Indexed View and Replicate the Indexed View as a Table. In the docs for sp_addarticle this is called #type = 'indexed view logbased'. Or there's lots of articles on the internet about this.
Solved it by creating a new SSIS job that handles that merge and runs once in a hour.
I dont need the data live in my webapp so this worked for me.
Related
We are wanting to use Azure servers to run our Power Apps applications, however we have local SQL servers which contains our data warehouse we want only certain tables to be on Azure and want to create data feeds between the two with information going from one to the other.
Does anyone have any insight into how I can achieve this?
I have googled but there doesn't appear to be a wealth of information on this topic.
It depends on how fast after a change in your source (the on premise SQL Server) you need that change reflected in your Sink (Azure SQL).
If you have some minutes or even only need to update it every day I would suggest a basic Data Factory Pipeline (search on google for data factory upsert). Here it depends on your data on how you can achieve this.
If you need it faster or it is impossible to extract an incremental update from your source you would need to either use triggers and write the changes from one database to the other or get a program that does change data capture that does that.
It looks like you just want to sync the data in some table between local SQL Server and Azure SQL database.
You can use the Azure SQL Data Sync.
Summary:
SQL Data Sync is a service built on Azure SQL Database that lets you synchronize the data you select bi-directionally across multiple SQL databases and SQL Server instances.
With Data Sync, you can keep data synchronized between your on-premises databases and Azure SQL databases to enable hybrid applications.
A Sync Group has the following properties:
The Sync Schema describes which data is being synchronized.
The Sync Direction can be bi-directional or can flow in only one
direction. That is, the Sync Direction can be Hub to Member, or
Member to Hub, or both.
The Sync Interval describes how often synchronization occurs.
The Conflict Resolution Policy is a group level policy, which can be
Hub wins or Member wins.
Next step, you need to learn how to configure the Data Sync. Please reference this Azure document:Tutorial: Set up SQL Data Sync between Azure SQL Database and SQL Server on-premises.
In this tutorial, you learn how to set up Azure SQL Data Sync by creating a sync group that contains both Azure SQL Database and SQL Server instances. The sync group is custom configured and synchronizes on the schedule you set.
Hope this helps.
The most robust solution here is Transactional Replication. You can also use SSIS or Azure Data Factory for copying tables to/from Azure SQL Database. And Azure SQL Data Sync also exists.
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.
Can we sync views on local database with tables on SQL azure database using SQL Azure Datat Sync[Preview]? If yes, then how?
In my opinion, the jury is still out on SQL Azure Data Sync. It's been in preview for years and still is.
When you say sync, and you looking to take the results of a local view and persist them as a table in SQL Azure?
If so, you can create a SELECT INTO, taking the data from the local view and letting the SELECT INTO make a table out of it. There are some things you need do to make the SQL Azure DB available locally:
http://msdn.microsoft.com/en-us/library/azure/ee336282.aspx
https://dba.stackexchange.com/questions/59328/insert-to-sql-azure-through-linked-server-very-slow
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
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.