From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

backup database

I wonder if there's any way to backup SQL database using LabView?

 

0 Kudos
Message 1 of 9
(2,261 Views)

This depends on the database system.

0 Kudos
Message 2 of 9
(2,201 Views)

If you have SQL Server you can send a SQL command to perform a backup.

https://www.mssqltips.com/sqlservertutorial/20/sql-server-backup-database-command/#:~:text=Create%20....

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 3 of 9
(2,170 Views)

What do you mean by database system?

I am using SQL Express server. I am writing a program to backup the database periodically and save it to a shared folder. 

0 Kudos
Message 4 of 9
(2,141 Views)

The backup need to be daily. 

The database name is same as the PC name and it needs to be run on multiple mchine.

in in other words one program to be run on multiple machines.

The link that you sent assumes the database name does not change. 

 

0 Kudos
Message 5 of 9
(2,140 Views)

@LV2020 wrote:

The backup need to be daily. 

The database name is same as the PC name and it needs to be run on multiple mchine.

in in other words one program to be run on multiple machines.

The link that you sent assumes the database name does not change. 

 


I'm pretty sure you can figure out how to change the name dynamically ...

Also, why would you have different DB names? That's quite unusual.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 6 of 9
(2,134 Views)

As said, every database system has its own SQL commands to backup.

 

For MS SQL:

 

Get list of all databases from server by executing

 

SELECT name FROM master.sys.databases

 

This will also include some system databases you do not want to backup, so choose the desired ones, and run the backup for each separately by executing:

 

BACKUP DATABASE <YourDbName> TO DISK = '<YourFileName>'

 

Note that the destination is a file on the machine where the server is running, not from where the commands are sent.
I don't know for MS SQL, but e.g. MariaDB does not allow to overwrite an existing backup file for security reasons, so make sure to chose new file names every time.

0 Kudos
Message 7 of 9
(2,120 Views)

@LV2020 wrote:

What do you mean by database system?

 


 What you are using ... MySQL, PostgreSQL, MS SQL Server, Oracle, SQLite, MS Access, MongoDB, IBM DB2, Cassandra, MariaDB or any other database

0 Kudos
Message 8 of 9
(2,112 Views)

I am using my SQL

0 Kudos
Message 9 of 9
(1,938 Views)