?
Solved

Copying underlying files for SqlServer results in login error.

Posted on 2014-07-24
2
Medium Priority
?
150 Views
Last Modified: 2014-07-24
As I have documented this problem for myself I am attaching the description as a word document which has screenshots.

I am copying underlying data files for sqlserver from development to production and I am getting the security errors in the document.

There is a fix for the problem as noted in the Word doc but as I have to refresh the data often I really do not want to have to run the fix every time I copy underlying files (from DATA directory) over.
Note.  I always copy the .mdf as well as the .ldf.
forExperts.docx
0
Comment
Question by:supportoranges
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 40

Accepted Solution

by:
lcohan earned 2000 total points
ID: 40216930
"In the future refreshing underlying table and log file shouldn’t create such hassle!"

you need to understand and remember that a SQL login is tied to the SQL Server Instance AND saved inside your database as well but as you copy the DB from one server to another obviously the login from server A is not identical with the login from server B even if they have the same name so that's why you need to rebind the login from copied database to the login from the DEV server.

You should be able to workaround this by using sp_dropuser/sp_adduser in the database you moved to bind it to the SQL server login
0
 
LVL 1

Author Closing Comment

by:supportoranges
ID: 40216944
Thank you so much I appreciate it.
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question