You must Sign In to post a response.
  • Category: SQL Server

    SQL Server - Full Back up & Differential Backup

    Hi

    How to take Full Back up & Differential Backup of a database using SQL script?
  • #765666
    Full sql backup
    Execute the BACKUP DATABASE statement to create the full database backup, specifying:
    - The name of the database to back up.
    - The backup device where the full database backup is written.
    The basic Transact-SQL syntax for a full database backup is:
    BACKUP DATABASE database
    TO backup_device [ ,...n ]
    [ WITH with_options [ ,...o ] ] ;

    Differential backup
    BACKUP DATABASE AdventureWorks
    TO DISK = 'C:\AdventureWorks.BAK'
    WITH DIFFERENTIAL
    GO

    Thanks
    Koolprasd2003
    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]

  • #765667
    In the full backup you will get all the data and pages.
    In the differential backup you will get only the pages that have changed since previous full backup.
    For Full backup

    BACKUP DATABASE <DBName>
    TO DISK = 'D:\DBBackup.bak'
    WITH FORMAT;
    GO


    For differential backup

    BACKUP DATABASE <DBName> TO <backup_device> WITH DIFFERENTIAL

    By Nathan
    Direction is important than speed

  • #765883
    FullBack UP:

    Complete Data Base Back up. This Data Base Backup self dependent same database or New Data Base Backup.

    BACKUP DATABASE DBName
    TO DISK = 'C:\DBName.BAK'
    GO

    Differential Backup:

    This Backup is only modified content when lastback up

    BACKUP DATABASE DataBaseName
    TO DISK = 'C:\DataBaseNames.BAK'
    WITH DIFFERENTIAL
    GO

    Hope this will help..


Sign In to post your comments