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
(439 Views)

This depends on the database system.

0 Kudos
Message 2 of 9
(379 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! ADDQ VIPM Now on GitHub
"Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
Certified-LabVIEW-Developer
Message 3 of 9
(348 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
(319 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
(318 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! ADDQ VIPM Now on GitHub
"Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
Certified-LabVIEW-Developer
0 Kudos
Message 6 of 9
(312 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
(298 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
(290 Views)

I am using my SQL

0 Kudos
Message 9 of 9
(116 Views)