Solved

Copying underlying files for SqlServer results in login error.

Posted on 2014-07-24
2
145 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

773 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