Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy database- will it create users and logins too?

Status
Not open for further replies.

glgcag1991

Programmer
Oct 15, 2007
72
0
0
US
Newbie question:

I have a production server that has SQL Server 2008 Express on it and I want to copy the database to a dev server.

First, the two servers cannot see each other, how do I do it if they are on separate networks?

Second, if I do a database copy, will all the users and logins be copied as well?

 
Backup/Restore or Detach/Attach will copy the users, it will not copy the logins. Google for sp_help_revlogin for a SQL Script which will create a script to create the logins on the other server with the same SID as the production server.

Denny
MVP
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / SQL 2005 BI / SQL 2008 DBA / SQL 2008 DBD / SQL 2008 BI / MWSS 3.0: Configuration / MOSS 2007: Configuration)
MCITP (SQL 2005 DBA / SQL 2008 DBA / SQL 2005 DBD / SQL 2008 DBD / SQL 2005 BI / SQL 2008 BI)

My Blog
 
Thanks Markros and MrDenny for the replies!

MrDenny, I looked at the sp_help_revlogin and it seems simple enough, but just so I know, is this what I should expect when developing? Do db admins that have to work on many remote sql servers have tools that better replicate the data, etc. between a dev and production server? (I guess it's not too much work, but somehow I thought it would be a little more automated.)

Also, what about service accounts? Is there a standard set of service accounts that I can rely on or do I need to ask about the service accounts in order to duplicate the service account settings on my dev box?

Thanks for your patience while I'm trying to get my head wrapped around this process!
 
Replicating logins is different than replicating normal data. There are processes in place for replicating data, called SQL Server replication that can replicate data from one server to another.

There is no standard set of service accounts. Those accounts would need to be created by someone and setup for use of the dev and production systems.

Denny
MVP
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / SQL 2005 BI / SQL 2008 DBA / SQL 2008 DBD / SQL 2008 BI / MWSS 3.0: Configuration / MOSS 2007: Configuration)
MCITP (SQL 2005 DBA / SQL 2008 DBA / SQL 2005 DBD / SQL 2008 DBD / SQL 2005 BI / SQL 2008 BI)

My Blog
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top