Error while Restoring Database

  • problem is occured when i restore datbase using query,and problem isolved by changing configuaration settings (built in user as local system) manually .

    my dbt is is there is any other method to solve this problem..

    without doing manually

  • Pls explain clearly and in detail.

    "Keep Trying"

  • i have to make a setup for installing sql express and restoring database

    using c#.net

    i have done following

    1.silent insatl sql express

    ..............

    "/qb SECURITYMODE=SQL SAPWD=\Password\" INSTANCENAME=\"SQLExpr\" DISABLENETWORKPROTOCOLS=0 " +

    "INSTALLSQLDATADIR=\"" + txtSql.Text + "\\SQLExpress\" INSTALLSQLDIR=\"" +

    txtSql.Text + "\\SQLExpress\" ADDLOCAL=All AUTOSTART=1";

    2.restoring database

    ..........................

    "restore database [DatabaseName] from disk='" + file + "' with" +

    " move '" + logicalFiles[0] + "' To '" + dir + "\\SchedulerPro_data.mdf'," +

    " move '" + logicalFiles[1] + "' To '" + dir + "\\SchedulerPro_log.ldf'," +

    " password=Password'";

    //---

    when executing 2nd one returns an error: cannot access folder data

    //--

    problem is solved when i change account as local system in configuaration manager manually

    ..

    is there is any other method that can solve using sql query

    advance thanks..

  • Does the account that cause the error have proper rights on the system.

    "Keep Trying"

  • please give me detaild instructions..

  • How do you login to sql server? with a network account login or sql login

    "Keep Trying"

  • It looks like you do not have permission to access that folder. Get the sysadmins to give you permission and it should work.

  • i am login with sql server authentication, and account type is network service and i am restoring database from same system in which sql server is insatlled.

    waiting ur reply

    thnks

  • if sql server is running under a network service you will need to assign permissions to the folder you are referencing in the code.

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

    "Ya can't make an omelette without breaking just a few eggs" 😉

Viewing 9 posts - 1 through 8 (of 8 total)

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