SQL Backing up, Restore and script based

 Hey Guys, I hope that you are enjoying with my blogs writing and today's we will cover some  "SQL SERVER" Concepts.


Microsoft SQL Server is a relational database management system, or RDBMS, developed and marketed by Microsoft.
As a database server, it is a software products with primary function of storing and retrieving data as requested by other software application.
Initial Releases is April 24, 1989;


  • Backup: A copy of SQL server data that can be used to restore recover the data after failure.
  • A backup of SQL server that is created at the level of database or one or more of its file or filegroup.
  • Full Backup: The most basic and complete type of backup is a full backup. This type of backup makes a copy of all data to a storage device, such as disk or tape  
  • Incremental Backup: It is a type of backup that only copies data that has been changed or created since the previous backup activity was conducted. 
  • Differential Backup: A data backup that is based on the latest full backup of a complete or partial database.
  • Incremental backup, sometimes called Differential backup while Differential backup are sometimes called "Cumulative backup".


  • Transaction Log: It is an integral part of SQL. Every database has a transaction file that is stored within the log file that is separated from data file It records all database modification.
      Steps for backup:
  •  Connect to the server and expand database -> Right click on database
  • A new windows will be open then select which type of backup you want , so I have selected full backup .

  • Select backup destination with .bak extension
  •    And finally its backup has completed.
  •     And this is my back file in D drive


     SQL Restore: It is the process of restoring data from one or more backups and then recovering the database.
Steps for Restore the data from database: Right click on database and restore and then
  • Select where you want to restore your data like Database/Device.
  • This is the Locate Backup file like it has in D drive(Backup1.bak)
                               
  •  And Finally Database 'Backup2' restored successfully.
                                                                           
       SQL Backup by Script: But its not a backup it make fresh entity table.
      Right click on database->Task->Generate Scripts -> then next 
   
                       
-> select specific database object.-> expand table -> next
         -> Go to Advanced if you want to backup data -> and select types of data to script ok

-> save to new query window . it will generate this new query and you will found full data.

Copy n Paste this Query in new query and select new database and execute your backup will be generated.


Thank You...!












No comments:

Post a Comment