Results 1 to 8 of 8

Thread: SQL Server 2005 Backup

  1. #1

    Thread Starter
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950

    SQL Server 2005 Backup

    Hey,

    I have an application in .NET 2005 which uses SQL Server 2005 express as the backend. I want to be able to allow the user to click a button and make a copy of the 2 database files and move them to a specific folder without having the user to stop the sql server services. Does anyone know how I can accomplish that?

    Thanks,
    Don't anthropomorphize computers -- they hate it

  2. #2
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: SQL Server 2005 Backup

    Look at this thread - it shows how to do a BACKUP in a STORED PROCEDURE.

    http://www.vbforums.com/showthread.p...t=backup+funds

    Search the FORUM for BACKUP FUNDS - you will find many other threads - if you want to look around...

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  3. #3

    Thread Starter
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950

    Re: SQL Server 2005 Backup

    thanks a lot.
    Don't anthropomorphize computers -- they hate it

  4. #4
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: SQL Server 2005 Backup

    btw - just to elaborate

    using BACKUP - which makes a hot-copy of the data and log - without getting users out is a good thing.

    The .BAK file is much smaller then the data and log files - you can direct it to backup to anywhere (but it is local drives on the SQL box - do not do a backup to a network drive or share).

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  5. #5

    Thread Starter
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950

    Re: SQL Server 2005 Backup

    ohh, so it doesn't just make a copy of the 2 files? It creates a bak file?
    Don't anthropomorphize computers -- they hate it

  6. #6
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: SQL Server 2005 Backup

    Why do you want to make a copy of the data and log files?

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  7. #7

    Thread Starter
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950

    Re: SQL Server 2005 Backup

    I thought that is what should happen. How would they restore the bak file?
    I was under the impression that both files would be copied and then the user can back them up using whatever media they have available to them. I just want to protect myself and allow them to make a copy of the data files.

    Thanks,
    Don't anthropomorphize computers -- they hate it

  8. #8
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: SQL Server 2005 Backup

    Nope - the .BAK file is the way to go.

    RESTORE will put it back into SQL if needed. Search the forum for BACKUP FUNDS and you will find RESTORE examples.

    We often use BACKUP to make a copy of a customer DB...

    Bring it to our office - and RESTORE to our servers here. You can even RESTORE to a new DB name - so we can have several copies of the same DB on the server.

    Getting the data and log requires a detach of the DB - so that no users are in it. BACKUP is a hot-copy method - respecting uncommited transactions and all that jazz.

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width