SQL Server Central is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
Search:  
 
 

Create_sp_help_revlogin_DB

By David A. Long, 2008/04/09

Total article views: 594 | Views in the last 30 days: 105

Microsoft's Transfer or Drop the logins and the passwords between instances of SQL Server 2005 script:
http://support.microsoft.com/kb/918992

Modified the Microsoft example to add:

@include_role = 1 parameter will add generate sp_addsrvrolemember script

@drop_accounts = 1 parameter will add generate DROP instead of CREATE works with @include_role to generate sp_dropsrvrolemember script

Generates the script to limit the LOGINs scripted to those related to a single database (requires search and replace for database name in this script and stored procedure re-creation)

Adds EXISTS logic to eliminate the need to edit script to eliminate error if the object already exists

Adds self-documentation to generated script & execution

Enjoy,

Andy

 

 

By David A. Long, 2008/04/09

Total article views: 594 | Views in the last 30 days: 105
Your response
 
 
Related tags

Backup/Restore    
Security    
SQL 2005    
 
Related content

What UDP port does SQL Server listen on?...

By Steve Jones | Category: Security
(not yet rated) | 5,336 reads

Mary is a member of a SQL Server...

By Steve Jones | Category: Security
(not yet rated) | 2,965 reads

How would you turn on C2-Level auditing?

By Steve Jones | Category: Security
(not yet rated) | 2,085 reads

You have SQL Server 2000 service pack 3a...

By Steve Jones | Category: Security
(not yet rated) | 2,069 reads
Already registered?  

Free registration required

To read the rest of this article, and access thousands of other articles, we ask you to register on the site and subscribe to our newsletters.

Register

E-mail address:
Password:
Password (confirm):

  

Subscriptions

We ask you to register on the site and subscribe to our newsletters. Subscribing to our newsletters gets you:

  • ALL of our content (thousands of articles, scripts, and forum postings)
  • A daily newsletter (example)
  • A weekly news round up (example)
  • The opportunity to ask and answer questions in our forums
  • A daily Question of the Day to test and help you increase your knowledge of SQL Server.

We ask that you give the newsletter a try for a week. Over 200,000 SQL Server Professionals a day find it entertaining and useful. If not, you are welcome to unsubscribe at anytime.

Steve Jones
Editor, SQLServerCentral.com