Solved

Copying underlying files for SqlServer results in login error.

Posted on 2014-07-24
2
143 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
2 Comments
 
LVL 39

Accepted Solution

by:
lcohan earned 500 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

757 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now