w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Best way to achieve - Data Sync between SQL Azure and Multiple On-Premises SQL server Databases
I have been working with SQl azure data sync, Microsift sync framework and Sql server change tracking. I have no idea about change data capture. Sql azure data sync. This is the easiest way to implement data sync. It is a matter of configuration. But unfortunately still in preview and Microsoft no recommended for production yet. We have been using to sync 20 databases spread around different geographical location and so far works good. No coding required. But you may have to pay in future when you are using this service. At the moment it is free. Microsoft Sync Framework Microsoft sync framework is for developers. Developers can use Sync framework as an API and develop sync application. Sql azure data sync use sync framework internally. To implement data sync with azure you need

Categories : SQL

MS Sync Framework: synchronize 1 client DB with 2 server databases
that should work for as long as you're always synching the same table to the same server. i.e., table C always synched table C in ServerDatabase2. the sync provider you're using has a table that contains "anchors" for every table you sync. The anchors are for last sent and last received timestamps (if you're using timestamps). There's only one row for each table, so it cannot keep track of the sync status of each table against multiple sync partners. a received anchor from Server A will be different from the anchors in Server B. so it will break if you sync the same table with Server A and then sync with Server B

Categories : Sql Server

Synchronize data between two sql server 2008 database with ado.net sync framework
I did synchronization a while ago and I used following tutorials Synchronizing SQL Server and SQL Express, although this one is between SQL Server and SQL Express but it will work just fine between two SQL Servers. Solution of some problems I faced can be found here Overview of how database synchronization works In summary you need to do following Provision Server database (only once) Provision Client database (only once) Do Synchronization

Categories : C#

Move record insert to SQL Server CE database into another thread? C# Compact Framework 3.5
If all of your processing is going to be done on the device (reading from the XML file on the device then parsing the data on the device), then you will see no performance increase from threading your work. These Windows Mobile devices only have a single processor, so for them to multithread means one process works for a while, then another process works for a while. You will never have simultaneous processes running at the same time. On the other hand, if the data from your XML file were located on a remote server, you could call the data in chunks. As a chunk arrives, you could process that data in another thread while waiting on the next chunk of data to arrive in the main thread. If all of this work is being done on one device, you will not have good luck with multithreading. You c

Categories : C#

Alternative solution beside SQL Data Sync to synchronize multiple Azure SQL instances?
You can use a full blown version of SQL Server on Windows Azure IaaS, which has multiple options for replication. I've personally tested Peer-to-Peer replication in SQL Server Enterprise on Azure between two distant data centers, and it met my needs perfectly. Of course, there is a financial cost to that product... so depending on the size of your organization, it may or may not be what you want to use.

Categories : Azure

merging 2 SQL Server databases with unique ID
Since you only have 2, one option is to "go negative". If you're using int or big int and your surrogate key data types.....AND you started all the seeding at (1,1) (or similar), you can negative'fy the surrogates of one database. However, you might have client code that checks for ">0", and that could screw you. Remember, the range is actually: MySurrogateKey int IDENTITY (-2147483648,1) (to positve 2147483648 )...it doesn't have to start at 1 (or 0).

Categories : Sql Server

Sync Master and multiple client database (bi directional) - MSSQL Server
The best way to achieve your goal is by using Merge Replication with Parameterized Row Filters. Merge Replication is bi-directional by default and parameterized row filters will allow you to only replicate branch specific data to slaves (subscribers) while maintaining a full copy at the master (publisher). Here are some links to get you started: Merge Replication Parameterized Row Filters

Categories : Sql Server

Creating a server database for my mobile app data sync
You need to create a service that will point to your server database you can use WEBAPI via app you can make a ajax call to this service passing data to and fro in json format. You can find sql lite plugin here

Categories : Eclipse

Async TCP Server in .NET Compact framework
Maybe it is in a part you haven't posted here, but I can't see anywhere some code where you empty the StringBuffer state.sb or the Queue _receivedData (just assuming the types by Name/Method). Filling this two ressources can bring your system to hang as at some point there is no more memory...

Categories : C#

query on multiple databases best solution
you can use like this: (but this is not a good practice to have multiple database for same. select d1.* from db1.dbcommon d1 inner join db2.tbluser d2 on d1.sender_id = d2.id UNION select d1.* from db1.dbcommon d1 inner join db2.tbluser d2 on d1.sender_id = d2.id

Categories : Mysql

Synchronization Central database with multiple local database
I wouldn't use syncronisation or replication. I would use an import/export mechanism. Write a little tool which will export the last day/week/month and than send it with an secure line to your main database for import.

Categories : PHP

Eclipse DLTK central database on server
Though I have not attempted this, it seems entirely possible to configure the H2's Connection profile to utilize an external URL. Follow these steps for configuring H2 but point the connection URL from local to the server. After transferring the database and pointing the driver's URL Connection at the server, you could disable the DLTK indexing on every machine except the server. I also recommend you have a look at the article suggested in this answer.

Categories : Eclipse

Set location of SQL Server Compact database on publish
You can include the DataDirectory macro, and set the location to an suitable place in code. connString = string.Format("Data Source=|DataDirectory|{0};", fileName); private void Application_Startup(object sender, StartupEventArgs e) { // This is our connection string: Data Source=|DataDirectory|Chinook40.sdf // Set the data directory to the users %AppData% folder // So the Chinook40.sdf file must be placed in: C:\Users\<Username>\AppData\Roaming\ AppDomain.CurrentDomain.SetData("DataDirectory", Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)); } This will require you to copy the database file to the desird location (if it does not exist already) during initial application launch.

Categories : Sql Server

ASP .Net Get Current User ID from SQL Server Compact database
Based on Managed Data Type Mappings (SQL Server Compact) by comparison to SQL Server Data Type Mappings it seems that Object is not a valid DbType and can not be mapped to SqlDbType in SQL Server Compact (but is valid in SqlServer). Since Userid is a Guid, try to replace: <SelectParameters> <asp:Parameter Name="UserId" Type="Object" /> </SelectParameters> <UpdateParameters> <asp:Parameter Name="HomeTown" /> <asp:Parameter Name="HomepageUrl" /> <asp:Parameter Name="Signature" /> <asp:Parameter Name="UserId" /> </UpdateParameters> With : <SelectParameters> <asp:Parameter Name="UserId" DbType="Guid" /> </SelectParameters> <UpdateParameters> <asp:Parameter Name="HomeTown" /> <as

Categories : C#

Multiple Databases with Play Framework 2.1.x
Ok, your application.conf seems to be correct. You may use the secondary server like this: EbeanServer secondary = Ebean.getServer("secondary"); secondary.find(User.class).findList(); Once you've got your secondary server, you may treat it just as you treat the Ebean singleton.

Categories : Java

Using entity framework on multiple databases
EF6 has better support for multiple DB access from Same context. Here is a snippet from EF5. Managing the database initializer setting prior is important. You may not want to trigger ANY migrations. i.e, use this before Database.SetInitializer(new ContextInitializerNone<MyDbContext>()); but to answer the question: Yes you can var conn = GetSqlConn4DbName(dataSource,dbName ); var ctx = new MyDbContext(conn,true); public DbConnection GetSqlConn4DbName(string dataSource, string dbName) { var sqlConnStringBuilder = new SqlConnectionStringBuilder(); sqlConnStringBuilder.DataSource = String.IsNullOrEmpty(dataSource) ? DefaultDataSource : dataSource; sqlConnStringBuilder.IntegratedSecurity = true; sqlConnStringBuilder.MultipleActiveResultSets = true;

Categories : Dotnet

Making a back up of A SQL Server Compact Edition Corrupts the database
Are you calling Create on an existing database file? According to the docs, Create creates or overwrites a file in the specified path. In the code you show, calling Create isn't necessary anyway. Just call File.Copy.

Categories : Vb.Net

Entity Framewok 5 - working out if the database is sql server or sql CE (compact edition)
This is surprisingly complicated! The simplest method (a.k.a. hack) is to execute SELECT @@version using DbContext.Database.SqlQuery (or DbContext.Database.ExecuteSqlCommand) and if it fails assume you are running CE.

Categories : Entity Framework

Sync framework get conflicting row data
When the ApplyChangeFailed event is raised by SqlSyncProvider, you use the DbApplyChangeFailedEventArgs object which provides information about the error or conflict that caused the failure. The e.conflict property contains moreover: RemoteChange: Gets the DataTable object that contains the conflicting rows from the remote database. LocalChange: Gets the DataTable object that contains the conflicting rows from the local database. These tables contain each one at most one row that represents the row in conflict. Datarow drRemote = e.Conflict.RemoteChange.Rows[0]; Datarow drLocal = e.Conflict.LocalChange.Rows[0]; To get the specific value in conflict in the row, I'm afraid there is no other way that manually comparing of each value from the DataRows. EDIT : @JuneT says that bette

Categories : C#

Why can't SQL Server Compact Edition open an existing SDF file if my connection string contains the max database size keyword?
Setting the DefaultConnectionFactory seemed to work for me: Database.DefaultConnectionFactory = new SqlCeConnectionFactory("System.Data.SqlServerCe.4.0");

Categories : C#

sync database between wp8 app and server
If you do not work with a large database, you might prefer to replace the device database and not worry about merging. This can be as simple as making an export of the server database, transferring it to the device and then importing it into the device database. The appropriate method of dumping the database on the server side is dependent on the type of database (e.g. mysqldump in the case of MySQL). If you do work with a large database, or if you are struggling with bandwidth issues on the device, you might want to use a technique to detect differences. One of the easiest methods is change tracking on the database. All modifications can then be logged with an change_at timestamp. The device can then remember which is the last modification it contains, get the new entries, and replicat

Categories : Windows Phone 8

Should use different schema/scope in MS Sync Framework when Multiple SqlSyncScopeProvisioning from different clients applied?
Each database instance participating in the sync requires its own Sync tracking tables/triggers/sprocs. The schema and scope have to do with the syncing process and there can be 1 or more.

Categories : C#

How to add condition while uploading and downloading data in MS sync framework?
you can specify a filter condition on what you want to sync. check out: http://msdn.microsoft.com/en-us/library/ff928701.aspx

Categories : Misc

Multiple databases(datacontext) on same server without MS DTC
With plain DbConnections, you can prevent DTC escalation for multiple databases on the same server by using the same connection string (with any database you like) and manually change the database on the opened connection object like so: using (var tx = new TransactionScope()) { using (var conn = new SqlConnection(connectStr)) { conn.Open(); new SqlCommand("INSERT INTO atest VALUES (1)", conn).ExecuteNonQuery(); } using (var conn = new SqlConnection(connectStr)) { conn.Open(); conn.ChangeDatabase("OtherDB"); new SqlCommand("INSERT INTO btest VALUES (2)", conn).ExecuteNonQuery(); } tx.Complete(); } This will not escalate to DTC, but it would, if you used different values for connectStr. I'm not familiar with EF and how

Categories : C#

SQL server multiple databases with same schema
This can be achieved using SSDT (Addin for VS) and Automated deployment tools (I use Final Builder). I currently use SSDT tools where I created a database project of the original schema. If there is any changes to one of the databases, i use schema compare in SSDT and update the database project. Then I follow the below steps to rollout the changes to other databases. Step 1: Update the schema changes to database Project. Step 2: Use MSBuild and Generate a deployment script by setting one of the databases as Target. Step 3: Run the generated script across all the databases using any auto deployment tools.

Categories : SQL

How to keep two MySQL databases in sync?
There's an answer to the duplication problem here. However, that's only the start of your difficulties. If two people are making changes independently to two copies of one database, merging the two will inevitably cause nightmares. In short, yes there will be merge conflicts. Exactly what, and what you do about it, will depend on the nature of the changes each of you have made. Good luck!

Categories : PHP

Theory of how to sync. (two) databases
The theory behind true replication (something like MySQL to MySQL) is very complicated and difficult. I wouldn't recommend trying to implement something like that for MySQL to SQL Server. Some things to look at: Look at Mule ESB (http://www.mulesoft.org/) You can get off the ground pretty fast with JDBC connections to MySQL and SQL Server. Then it's just a matter of how often you want to poll one endpoint to push to another endpoint. (For example, poll MySQL every 15 minutes and take the results and write to SQL Server.) You can write your own syncing program. Maybe export data from one system every 15 minutes and write to the file system. Have another program watch that directory and import anything it sees. (Disadvantage is you have to touch the disk.) To be really creative, you can w

Categories : Database

Sync databases using PhpMyAdmin
You can do this within php pretty easily...here are the scripts I use SYNCING $account_tables = $Db_stage->run("SELECT table_name, table_rows FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = '".$Init->container["Config"]->dbName."' ORDER BY table_name"); $production_tables = $Db_production->run("SELECT table_name, table_rows FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = '".$dbName."' ORDER BY table_name"); foreach ($account_tables as $account_table){ $dbDrop = "/usr/bin/mysql -u ".$Init->container["Config"]->dbUser." -p".$Init->container["Config"]->dbPassword." ".$Init->container["Config"]->dbName." -e 'drop table `".$account_table["table_name"]."`'"; echo "DROP ".$account_table["table_name"]."<br/>"; //echo $dbDrop."<b

Categories : PHP

Select from multiple SQL Server 2008 databases not working
Seems you not adding Authentication. try: EXEC sp_addlinkedsrvlogin @useself='FALSE', @rmtsrvname='TEST_LINK', @rmtuser='user', @rmtpassword='secret' Obviously edit the strings to your credentials and execute, should be able to connect then.

Categories : SQL

Merging two child tables from two different databases
First you need to be able to query both tables at the same time. You may need linked server or openrowset (or friends). Seeing as how you just want to merge child tables, the parent table is irrelevant. Then you need to figure out the logic of the merge. Let's say you want merge A into B. There are three types of situations: MATCHED NOT MATCHED [BY TARGET] NOT MATCHED BY SOURCE What do you want to do in each situation? After you have the design, the docs (http://technet.microsoft.com/en-us/library/bb510625.aspx) has very good examples. Basically you want: MERGE child as target USING (select ... from databaseA.dbo.child) as source (...) ON (conditions) WHEN MATCHED THEN UPDATE SET target.v = source.v WHEN NOT MATCHED BY TARGET THEN INSERT (v) VALUES (source.v) -- WHEN NO

Categories : Sql Server

Sync android database over multiple devices through Google or Facebook
With every Google account comes Google Drive. That link leads to the documentation for their API, but you will want to use their libraries as I presume. Basic understanding of OAuth workflow can be beneficial.

Categories : Android

sync data from file to database
You can create a temporary table which has the same columns with the employee table. Load the data from the file to the temporary table first, and then it’s pure sql operation. For example, delete those not in the file Delete from employee where employee_id not in (select employee_id from employee_tmp); insert those in the file but not in the table insert into employee select * from employee_tmp where empoyee_id not in (select employee_id from employee)

Categories : Java

Is there a "correct" way to sync databases between live and dev servers?
You can have a master-slave replication or master-master replication in MySQL. Master-slave replication The production server will be master server and the development server will be slave server. Master server will pass new data to slave server. However, if you make change at slave server, it will not update to production server. Master-master replication Setup both server as master, if production server changes, development server will change as well and vise versa. Further reading http://dev.mysql.com/doc/refman/5.5/en/replication-howto.html http://dev.mysql.com/doc/refman/5.0/en/replication.html

Categories : PHP

Strategy for keeping separate Databases in Sync
I know I've done with this with messaging in the past - specifically JMS with ActiveMQ. I would send the updates to a NoSQL store (Mongo) by using a queue. This way messages could accumulate in the queue and if the connection to the NoSQL store ever got severed, it could pick up where it left off. It worked really well because ActiveMQ was really stable and simple to work with. I've always seen this done with diffs like you mentioned. You introduce date fields all over and then keep track of the latest sync. The nice thing about this approach is that it easily allows you to replay transactions by modifying the last sync date. One last piece of advice ... write good tools around pumping data from point A to point B (in this case SQL to NoSQL). I wrote several tools to bulk load the NoSQL

Categories : SQL

Merging multiple, unaligned data-frames into single pandas data-frame
If you have the data-frames in a list (the actual data-frame objects, I mean, not their names) that looks something like this: dflist = [df1, df2, df3, df4, df5, df6, df7, df8] then the following code should do what it seems you're looking for: frame = {} for idx, df in enumerate(dflist): n = idx+1 # Since lists are 0-indexed name = "df{0:d}.Close".format(n) close = df["Close"] frame[name] = close You could do this more compactly with a dict comprehension, but in example code I prefer to spell things out more explicitly for ease of understanding. For reference, the dict comprehension would look something like this: {"df{0:d}.Close".format(idx+1): df["Close"] for idx, df in enumerate(dflist)}

Categories : Python

Sync Core Data to web server
You could take a look at using RestKit to help you with the communication with the server. Yes, you will want to add some additional data to allow you to determine if the data has been edited since it was last synched with the server. A BOOL should be sufficient for this, just set it when any other attribute is changed (you can use KVO to assist with this). You will need to create and control the logic for which updates are sent back to the server and when. If you post the individual object then RestKit could respond and automatically set the BOOL back to false for you (but whether you want to do that depends very much on how many objects are changing, how often and how big they are - you don't want to make lots of frequent small updates to the server).

Categories : Iphone

SQL Server : Merging Several Rows of Data into a Single Row
This will work, but since there is no identity or datetime column - there is no way to find which update row is newer. So if there are more updates on the same column, I just take the first alphabetically/numerically (MIN). WITH CTE AS ( SELECT ID, REF, MIN(Title) Title, MIN(Surname) Surname, MIN(Forename) Forename, MIN(DOB) DOB, MIN(Add1) Add1, MIN(Postcode) Postcode FROM Table1 GROUP BY id, REF ) SELECT d.REF , d.ID , COALESCE(T.Title, d.TItle) AS Title , COALESCE(T.Surname, d.Surname) AS Surname , COALESCE(T.Forename, d.Forename) AS Forename , COALESCE(T.DOB, d.DOB) AS DOB , COALESCE(T.Add1, d.Add1) AS Add1 , COALESCE(T.Postcode, d.Postcode) AS Postcode FROM CTE d INNER JOIN CTE t ON d.ID = t.ID AND d.REF = 'D' AND t.REF = 't' SQLFiddle DEMO If ident

Categories : SQL

One-Way sync of data without changing schema of source database
SQL Change Tracking is only supported on the older offline providers (SqlClientSyncProvider/DbServerSyncProvider/SyncAgent). The newer providers you're trying to use (SqlSyncProvider/SyncOrchestrator) requires a custom change tracking. You cannot mix and match the database sync providers. have you looked at using SSIS instead?

Categories : SQL

Sync users table data from 6 different mysql database
This one selects all emails that are missing in one of the databases and points out in which database they are present. SELECT email, GROUP_CONCAT(db_Name) AS emailIsOnlyIn FROM ( SELECT 'db1' as db_Name, email FROM db1.yourTable UNION ALL SELECT 'db2' as db_Name, email FROM db2.yourTable UNION ALL SELECT 'db3' as db_Name, email FROM db3.yourTable UNION ALL SELECT 'db4' as db_Name, email FROM db4.yourTable UNION ALL SELECT 'db5' as db_Name, email FROM db5.yourTable UNION ALL SELECT 'db6' as db_Name, email FROM db6.yourTable ) subquery_alias GROUP BY email HAVING COUNT(DISTINCT db_name) < 6; If you want to know in which database an email is missing it's a bit more complicated: SELECT * FROM ( SELECT email FROM db1.yourTable UNION SELECT emai

Categories : Mysql

How to sync data from address book to server?
Use ABPeoplePickerNavigationControllerDelegate to retrive Email from contact list using kABPersonEmailProperty. - (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person { CFStringRef emailName = nil; ABMultiValueRef emails = ABRecordCopyValue(person, kABPersonEmailProperty); emailName = ABMultiValueCopyValueAtIndex(emails, 0); /* Here make code for DB 1) Make email Field of DB unique. 2) select query like: select * from tblContact where email = emailName; get count of Record set. 3) if record set count == 0 then insert emailName in tblContact using insert Query. else Do nothing

Categories : Iphone



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.