Sql-server – how to restore database from other server – sql

restoreSecuritysql server

I have backup database from server A. Then I want to restore it in server B.
I have manage to restore it, but I cannot connect to it when running my VB program. I already change the configuration file, but still doesn't work.

I guess that I need to change something related with the permission, but I dont know what should I change. Anyone can help me?

Best Answer

In the absence of more information, I'll guess SQL Server.

  • SQL Server uses logins to connect at the Instance (server) level
  • A login maps to a user in a databases

You can see this in SSMS in the Security nodes on Object Explorer.

I suspect you have "orphaned" users. That is, the users in your restored database no longer have an associated login to map to. This need recreated (Windows logins) or remapped (SQL logins)

The MSDN article Troubleshooting Orphaned Users has checks, fixes and more details. I'd simply copy/paste or re-hash this so I recommend you look at this.