R- Shiny- SQL- Dropbox: can they work together? - sql

We have a shiny app running from our institute server (basically modifying a table).
We would like to store the table in an SQL DB.
Is it possible to save the SQL DB in a Dropbox account and interact with it from there?
Pseudocode:
load table from Dropbox SQL db
create DT data table
modify the data table in shiny
Update the SQL DB in Dropbox
I am asking for any working examples illustrating the first and last steps above.
Many thanks!!

I'm not sure what you're referring to by "Dropbox SQL db" - does Dropbox have an own SQL service? I believe not. Do you have some kind of SQL dump in the dropbox?
Anyways, what you could do, is setting up a sqlite database and save it to the dropbox. To my knowledge, SQLite does not support concurrent connections, but if only one user is accessing the SQLite db, then it should work.
Check out RSQlite.
/Edit: Of course, the institute server also has to have direct access to the dropbox.

Related

Best way to set up a new database on a new server which periodically refreshes tables from a live SQL Server?

I need to create a database solely for analytical purposes. The idea here is for it to start off as a 1:1 replica of a current SQL Server database but we will then add in additional tables. The idea here is to be able to have read-write access to a db without dropping anything in production inadvertently.
We would ideally like to set a daily refresh schedule to update all tables in the new tb to match the tables in the live environment.
In terms of the DBMS for the new database, I am very easy - MySQL, SQL Server, PostgreSQL would be great -- I am not hugely familiar with the Google Storage/BigQuery stack but if this is an easy option, I'm open to it.
You could use a standard HA/DR solution with a readable secondary (Availability Groups/mirroring /log shipping).
then have a second database on the new server for your additional tables.
Cloud Storage and BigQuery are not RDBMS services themselves, but could be used in this case to store the backups/exports/dumps from the replica, and then have the analytical work performed on those backups.
Here is an example workflow:
Perform a backup and restore in a different database
Add the new tables in the new database
Export the database as a CSV file on your local machine
Here you could either directly load the CSV file in BigQuery, or upload that file in a Cloud Storage bucket previously created
Query the data
I suggest to take a look at the multiple methods for loading data in BigQuery, as well as the methods for querying against external data sources which may help to determine which database replication/export method might be best for your use case.

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/

how to get data from table if table stored in database which is in server in ios.

i need some help.
I am trying to fetch data which is in table format in SQL Database and my Database is in server.So can anybody tell me a procedure how to do this in efficient way.
Thank you
Generally the most common approach is encapsulate the database by an REST API (see http://en.wikipedia.org/wiki/Representational_state_transfer).
However, you could look for an SQL Connection SDK provided by the manufacturer of your SQL Server. There is also an ODBC SDK for iOS you can take a look at.

how can communicate two SQL database in LAN to save data in both database

We have a server with SQL database (8 database) working in LAN, Now we are planning to make a backup server connected through LAN.
What we need is, when user enter data it should save in both database, so that we have all the data in both database.
I am a newbie so pls give me some detail information. I have seen some replication option, is it better option for us.
We have SQL Server 2005.
Which database engine are you using?
There're several ways to build a distributed/replicated database, I'm sure you'll find out how to do it by reading your engine documentation, but we cannot help here without more info.
Yes, you can backup your database from one server to other by multiple way.. Following are those
1) Make script of complete database with schema and data..Technique is here
2) Export your database to excel file and import it to other server (Use only in required conditions).
3) communicate two server by addlink.. Technique here
Now if you want dump data in two different server then its depend on code logic written for dumping database and connection string provided for it. By adding Trigger to one server database you can dump data on different server or database.. Trigger

Keeping database structure compatible between MS-Access and SQL Server

I'm working on a legacy project, written for the most part in Delphi 5 before it was upgraded to Delphi 2007. A lot has changed after this upgrade, except the database that's underneath. It still uses MS-Access for data storage.
Now we want to support SQL Server as an alternate database. Still just for single-user situations, although multi-user support will be a feature for the future. And although there won't be many migration problems (see below) when it needs to use a different database, keeping two database structures synchronized is a bit of a problem.
If I would create an SQL script to generate the SQL Server database then I would need a second script to keep the Access database up-to-date too. They don't speak the same dialect. (At least, not for our purposes.) So I need a way to maintain the database structure in a simple way, making sure it can generate both a valid SQL Server database as an Access database. I could write my own tool where I store the database structure inside an XML file, which combined with some smart code and ADOX would generate both database types.
But isn't there already a good tool that can do this?
Note: the application also uses ADO and all queries are just simple select statements. Although it has 50+ tables, there's one root "Document" table and the user selects one of the "documents" in this table. It then collects all records from all tables that are related to this document record and stores them in an in-memory structure. When the user saves the data, it just writes the document record and all changed data back to the database again. Basically, this read/write mechanism of documents is the only database interaction in the whole application. So using a different database is not a big problem.
We will drop the MS-Access database in the future but for now we have 4000 customers using this application. We first need to make sure the whole thing works with SQL Server and we need to continue to maintain the current code. As a result, we will have to support both databases for at least a year.
Take a look at the DB Explorer, there is a trial download too.
OR
Use migration wizard from MS Access to SQL Server
After development in Access (schema changes), use the wizard again.
Use a tool to compare SQL Server schemata.