Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2011
    Posts
    1

    Unanswered: restore backup database

    Hi
    Actually i don't have any idea with SQL and ASP.NET, therefore i'm searching for "restore my backup .bak" database folder. After searching i found the below code, but i don't know how to put this code in asp or aspx page. Can any one help me provide me asp or aspx page so i can downloaded and copy it in my server to restora my database

    USE master
    GO
    -- First determine the number and names of the files in the backup.
    -- MyNwind_2 is the name of the backup device.
    RESTORE FILELISTONLY
    FROM MyNwind_2
    -- Restore the files for MyNwind2_Test.
    RESTORE DATABASE MyNwind2_Test
    FROM MyNwind_2
    WITH RECOVERY,
    MOVE 'MyNwind2_data' TO 'C:\MyData\MyNwind2_Test_data.mdf',
    MOVE 'MyNwind2_log' TO 'C:\MyData\MyNwind2_Test_log.ldf'
    GO

    regards
    .

  2. #2
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,799
    Provided Answers: 11
    I don't think I would put a restore command in an ASP.NET page, for a few reasons. First off, the web applications needs some significant permissions on the server. Is there a reason you are not using SQL Server Management Studio to do the restores?

Posting Permissions

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