How to copy ms sql file to a server.
Results 1 to 12 of 12

Thread: How to copy ms sql file to a server.

  1. #1
    Join Date
    Jul 2014
    Posts
    8

    How to copy ms sql file to a server.

    How to copy ms sql file to a server.
    I create a MS SQL database. Using Visual Studio I created a Web Site using the data.
    I want to update the data so I was able to important to my local machine.
    I made a copy of the local database (hrd.mbf) with the idea to just paste it on the server to replaces (hrd.mbf) on the server.
    On the server
    I put hrd.mbf offline when renamed it (hrd1.mbf)
    I copied hrd.mbf.
    In the SQL Server object Explorer it showed hrd (suspect) it added the word “suspect” next to the table.
    I use Visual Studio to create a login page so only some employees can see the data. When I go to page it asks to login, which is what it is supposed to do when I to login I get an error message saying that it cannot connect to the hrd.
    Does anyone know the correct way to do this?

  2. #2
    Join Date
    Sep 2002
    Posts
    5,900
    Are you talking about sql server db or Access db? They are completely different.

  3. #3
    Join Date
    Jul 2014
    Posts
    8
    Quote Originally Posted by rmiao View Post
    Are you talking about sql server db or Access db? They are completely different.
    Sql server

  4. #4
    Join Date
    Sep 2002
    Posts
    5,900
    Sql server doesn't use .mbf by default. Anyway, better to do backup/restore for sql db instead of file copy. Have to copy log file too if you still want to copy files.

  5. #5
    Join Date
    Jul 2014
    Posts
    8
    Quote Originally Posted by rmiao View Post
    Sql server doesn't use .mbf by default. Anyway, better to do backup/restore for sql db instead of file copy. Have to copy log file too if you still want to copy files.
    Thanks so far

    I have the database on the network I used the backUP
    when I try to access it with the browser I get an error message.

    Cannot open database "DatabaseName" requested by the login. The login failed.
    Login failed for user 'Databaseuserdb'.

  6. #6
    Join Date
    Jul 2014
    Posts
    8
    Quote Originally Posted by earlcools View Post
    Thanks so far

    I have the database on the network I used the backUP
    when I try to access it with the browser I get an error message.

    Cannot open database "DatabaseName" requested by the login. The login failed.
    Login failed for user 'Databaseuserdb'.

    I am not sure if that would be the problem the local machine database had windows authentication
    When I made the backup. The one on the network uses SQL Authentication.

  7. #7
    Join Date
    Sep 2002
    Posts
    5,900
    Just add sql login as user of the db and grant proper permissions.

  8. #8
    Join Date
    Jul 2014
    Posts
    8
    Quote Originally Posted by rmiao View Post
    Just add sql login as user of the db and grant proper permissions.
    I have tried not sure what I am doing wrong.

    <add name="DefaultConnection" connectionString="Data Source=10.5.41.19;Initial Catalog=aspnet-cxcDB-20130627224632.mdf;User ID=sa;Password=P@Dalia3636" providerName="System.Data.SqlClient" />
    <add name="CXCDBConnectionString1" connectionString="Data Source=10.5.41.19;Initial Catalog=CXCDB;User ID=sa;Password=P@Dalia3636" providerName="System.Data.SqlClient" />

    thanks for help

  9. #9
    Join Date
    Sep 2002
    Posts
    5,900
    You have to grant sql permission in sql server not in connection string, do you have dba in your company by the way?

  10. #10
    Join Date
    Jul 2014
    Posts
    8
    Quote Originally Posted by rmiao View Post
    You have to grant sql permission in sql server not in connection string, do you have dba in your company by the way?
    I

    I am the one in charge of the database and the site so i guess i am the dba (if that's ok with you)

  11. #11
    Join Date
    Sep 2002
    Posts
    5,900
    That's fine with me but looks like you need basic dba training.

  12. #12
    Join Date
    Jul 2014
    Posts
    8
    Quote Originally Posted by rmiao View Post
    That's fine with me but looks like you need basic dba training.
    this is my first application.

    I appreciate the love shown.

    thanks for trying to help me.

Posting Permissions

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