How to take Backup at runtime in SQLExpress-2005

  • Hi All

    I am developing one Windows application... That application using one database named as INVENTORY..All my tables and SP are there in that INVENTORY database...

    Requirement

    ---------------

    I hve one menu 'Take BackUp'.....

    so how to take Backup that database while i am using that database..

    what will be the query.. I mean what i will write in my .Net .cs file to take Backup of that Database...

    Susant
    9967487567

  • susant (12/25/2008)


    Hi All

    I am developing one Windows application... That application using one database named as INVENTORY..All my tables and SP are there in that INVENTORY database...

    Requirement

    ---------------

    I hve one menu 'Take BackUp'.....

    so how to take Backup that database while i am using that database..

    what will be the query.. I mean what i will write in my .Net .cs file to take Backup of that Database...

    Before taking backup, i suggest you ask your DBA about the recovery model that he's set for the database. Is there a backup policy or you want it to be taken 'at-will' using your application.

    If u're taking it from application, the login must have the privilages of a db_backupoperator on ur database.

    For full backup you need to write something like this.

    Backup database INVENTORY to DISK='your backup path'

    Please refer Books online for detailed options which you can use with your backup statement.



    Pradeep Singh

  • You can also take a backup using SMO in your C# application. Check out this video at jumstarttv.com for the how-to.

  • Be sure that you manage the backup files as well. Perhaps delete the ones older than the last 2 after the backup completes.

  • Hi Jack

    The link u have given 'jumstarttv.com ' is not exist...

    and one more thing can u send me some details on SMO.. I mean how to work integrate with my .Net application for taking Backup...

    Susant
    9967487567

  • The word "video" is a link also and that one works. I messed up when I put the jumpstarttv link in.

    I don't know that much about SMO as I have not written any applications to manage SQL Server as I use SSMS, which is why I pointed you to jumpstarttv. You can also use SQL BOL and google SMO.

  • susant the link is http://jumpstarttv.com/

    video is at http://www.jumpstarttv.com/backing-up-your-database-with-smo_411.aspx



    Pradeep Singh

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply