Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 Moving logins

Author  Topic 

laddu
Constraint Violating Yak Guru

332 Posts

Posted - 2009-09-02 : 16:06:47
I have restored a db in new server. Now I want 2 logins from the old server. Is there any way to script those two logins with permissions and create in new server?

Thanks.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-09-02 : 16:10:33
The simplest method for just 2 logins is to use this: http://www.sqlmag.com/article/articleid/16090/16090.html

For lots of logins, I wrote this: http://weblogs.sqlteam.com/tarad/archive/2008/06/24/How-to-transfer-SQL-logins-between-SQL-Server-2005-instances.aspx

I don't have a script for permissions.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

ScottWhigham
Starting Member

49 Posts

Posted - 2009-09-03 : 10:16:06
quote:
Originally posted by laddu

I have restored a db in new server. Now I want 2 logins from the old server. Is there any way to script those two logins with permissions and create in new server?

Thanks.

What "permissions" are you wanting to script out? When you restore the database, the user permissions will already be present.

And FYI: Tibor's script is for SQL 7/2000 servers. It will work in 2005/2008 but will not bring over things like policy adherence, status, or any of the new features/roles in 2005/2008.

I think this is the simplest method: [url]http://support.microsoft.com/kb/246133[/url]

========================================================

I have about 1,000 video tutorials on SQL Server 2008, 2005, and 2000 over at http://www.learnitfirst.com/Database-Professionals.aspx
Go to Top of Page

krishnarajeesh
Yak Posting Veteran

67 Posts

Posted - 2009-09-03 : 12:22:06
Try this link

http://www.sqlserver.in/index.php/administration/51-database-migration/100-how-to-transfer-logins-and-the-passwords-between-sql-servers.html

Its shows how to use sp_revlogin Microsoft script to migrate logins between servers.

Thanks,
Krishna
www.SQLServer.in
Go to Top of Page

sunsanvin
Master Smack Fu Yak Hacker

1274 Posts

Posted - 2009-09-07 : 16:34:45
sp_revlogin is the procedure, use that you will be all set

Arnav
Even you learn 1%, Learn it with 100% confidence.
Go to Top of Page
   

- Advertisement -