Transferring specific data from one db to another locally - sql

Ok here is the situation. We have a client application that contains a local sql database. At any given time, they could be working in the field and may have no internet connection at all. This means they cannot sync back to the server or to anything else. Client A needs to export specific pipe information that will include data from several tables and will have to hand off this information to Client B that will continue to work on this. Client A will then need to put this information on a file and give to Client B. Client B will then need to import this pipe information into his local database.
I'm brainstorming for ideas of what could be the best solution to accomplish this?
So far querying the specific pipe information, writing to a file in xml and then importing the xml and writing to the database could be an option.
Or just querying the information and writing sql scripts that can be executed on client Bs machine.
We just can't export the entire databases information from one computer to another. It has to be only specific information the user wants to export.

Related

I would like to set up a notification trigger when new data is added to a remote server. What is the best approach?

I'm a little lost and need some guidance on how to approach this feature I'd like to add.
Many operations I use require retrieving data from a remote server. My goal is to be able to receive an email notification if new data has been added to the remote server.
I thought about creating a stored procedure that uses "openquery" and compare data to a local table with a conditional statement that will send out an email if there are differences. Then scheduling a job that will execute this stored procedure frequently. But this does not feel elegant at all...
If I understood your question correctly, all depends on the permissions.
If I was the owner of the system
Find out which job is adding data to the system. Modify the process (ETL/ SQL job etc.) to send you an email. (best way)
If you have create permissions on the remote system
Create an after insert trigger, see the first example here. Refer to this link as well. (2nd best way)
If you have just permissions to create linked server
Whatever you wrote/ you can bring the data from the server (just the primary keys from the table) and keep on checking that by creating a job for new primary keys if any by copying the data to local.
How to choose between these two: depends on the size of data. Second method mentioned in point 3 will work even without a linked server.
But you will have to run this again and again, I can't think of any other way. Set up a SQL job/ ETL to do this for you.

What file format can be use to save/access data instead on database

There is a situation in my company where we are developing a light weight .net web application with least dependencies. Application will be used hosted on client server. However there will not be any internet connection and they will use application locally.
We do not want any type of database installation on client machine. We want to keep it as simple as possible on client side. for this purpose we want to save/access data from file, as data on client side will not exceed more than 100 000 rows. We are also concerned about the speed for accessing data.
Here I want to ask how the data should be saved in file so that it can be accessed fast? What file format should be?
Whether I can use any db file which does not require any database installation on client side.
You could save all data to a json file, this will become increasingly slow and prone to corruption.
Also, have a look at SqlLite.
You can try Sql Compact Edition or SqlLite. Both are file based solution and fit as per your need.
Advantage of using these two would be that you can perform almost all the database queries on it and the data retrieval will be very fast. Also the you can think of optimizing the data storage and create tables etc.
You can use SQLite which is heavily uses in such scenarios (among others used by Chrome and Firefox). It is even public domain, so no license costs etc.

Storing information across devices without a database

I've seen examples of web apps that has user accounts and stores information about the users, but does not use a database. I've been searching for a while and cannot figure out how this would be done without a database. Can someone point me in a direction?
Clearly the data has to be stored somewhere. It could stored on the client, using cookies or HTML5 Web Storage, but this would make it nearly impossible for the data to be shared across devices. (Technically, the data could be shared between devices provided that another device maintains an active connection to the web server at the same time; the web server would merely transfer the data between devices without storing it. However, this would be extremely impractical.) If the user data is stored in any centralized location, there would effectively be a database, even if specialized database software, such as MySQL, is not used, i.e. just using the filesystem of the server directly.
Some used database such as SQLite to store data, but for other application they simply saved it to a file somewhere in the directory (may be cookies, temporary file, settings/configuration, ....etc).
There are 2 main ways of storing data based on the requirement:
Storing data On client
1.HTML5 Webstorage is now available, which store data locally and it can support data upto 5MB and it is more secured and faster.
2.Cookies
Storing data On Server
Through flat files that is text file or through XML files.XML is standard in many companies as a way to store data. This is really quick.
Having said that, there are downsides to it as well.

Connection between the database system and a browser

I want to create a database system then upload this system to any browser. .. I'm really beginner in this area and I want to know what tools should I use and what is the best program to use in order to implement it ?? after I implement it I should put it in a server and it should have a specific IP address
As far as i understood ...
you want:
1) a client that gathers data
2) store this data in a local database
3) upload this data to a database located on a server.
there are several ways to do this:
1) upload the database file manually using a simple webform and read the database file on the server. (this might raise problems when you have inconsistent data ...)
2) read the database file with a client program and upload the data only to e.g. a REST API. (same problem of inconsistent data)
3) skip the local database part and just submit directly to the server.
(most common way of storing data on a server)

Can't relink mdb file with Linked File Wizard

So, I've got an access database that I want to open.
I can see the querys/forms/tables exist but when I want to open them it tells me
"X:[...]\database.mdb" is not a valid path. Of course, because this is my computer. So when I select them to relink them in the wizard, I select the current database file and it just tells me, that the query/form/table doesn't exist in there and I should check the name.
But I am in that database and I can see those forms exist. The database itself is just around 1mb, is there something msissing maybe? Don't think so, huh.
It looks like your Access database project has been split into Front-End and Back-End databases.
This is normal practice for an Access database project of any significant size.
It seems you have the front-end database - this is the one containing the forms etc. Yes, it will list the tables but all those tables are just links. The underlying data is not in this front-end database, but in the back-end.
If your tables are shown with a small arrow then these are linked tables and a sure sign you have a front-end database:
When you fire up the Linked Table Wizard you need to browse to the back-end database, not the current database. If you cannot locate the back-end or no longer have it, then basically, you have no data. Your front-end database may be of little value on its own.