From the course: Microsoft Azure Database Administrator Associate (DP-300) Cert Prep by Microsoft Press

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Backup and restore a database using T-SQL

Backup and restore a database using T-SQL

- Welcome back. This is Lesson 14.6, "Backup and Restore a Database Using T-SQL." Earlier in this lesson we talked about how to do database backups and restores using the tools. For example, SQL Server Management Studio. This video is about doing database backups and restores using T-SQL. But before we get into the T-SQL, the best way to do backups, database backups and restores with T-SQL, is to actually let the database backup and restore dialogue, write the T-SQL for you. So during the database backup and restore configuration, when you're walking through the wizard to either back up a restore database, there is a script button on the toolbar at the top of the dialogue box. Click that and it gives you different scripting options. Script to a new query window is what we want as that opens up a new query window with the T-SQL in it. Script to file saves the T-SQ to a .SQL file. Script to clipboard copies the generated T-SQL to the clipboard. And script to job creates a new SQL server…

Contents