SQL

SQL BACKUP DATABASE for SQL Server

Hello All,

Hope this post finds you in good health and spirit.

Structured Query Language, abbreviated as SQL, is a domain-specific language used in programming and designed for managing data held in a relational database management system, or for stream processing in a relational data stream management system.

An good developer must be familiar with a few commands in SQL because it is such a strong development tool. The SQL queries listed below are important for coding and optimization. Almost every system that interacts with a SQL database will be affected by each query in the SQL tutorial.

SQL BACKUP DATABASE for SQL Server

The BACKUP DATABASE statement is used in SQL Server to create a full back up of an existing SQL database.

BACKUP DATABASE databasename
TO DISK = 'filepath';

The SQL BACKUP WITH DIFFERENTIAL Statement
A differential back up only backs up the parts of the database that have changed since the last full database backup.

BACKUP DATABASE databasename
TO DISK = 'filepath'
WITH DIFFERENTIAL;

BACKUP DATABASE Example
The following SQL statement creates a full back up of the existing database “testDB” to the D disk:

BACKUP DATABASE testDB
TO DISK = 'D:\backups\testDB.bak';

Tip: Always back up the database to a different drive than the actual database. Then, if you get a disk crash, you will not lose your backup file along with the database.

BACKUP WITH DIFFERENTIAL Example
The following SQL statement creates a differential back up of the database “testDB”:

BACKUP DATABASE testDB
TO DISK = 'D:\backups\testDB.bak'
WITH DIFFERENTIAL;

Tip: A differential back up reduces the back up time (since only the changes are backed up).

So, that’s all in this blog. I will meet you soon with next stuff .Have a nice day !!!

Recommended contents

Guys please don’t forget to like and share the post.Also join our WindowsTechno Community and where you can post your queries/doubts and our experts will address them .

You can also share the feedback on below windows techno email id.

If you have any questions feel free to contact us on admin@windowstechno.com also follow us on facebook@windowstechno to get updates about new blog posts.

How useful was this post?

Click on a star to rate it!

As you found this post useful...

Follow us on social media!

Was this article helpful?
YesNo

Leave a Reply

Check Also
Close
Back to top button