Blog do Ezequiel
  SQL Server Insights


June, 2010

Latest Updates
06/02/2015 - Latest update on the AdaptiveIndexDefrag procedure v1.6.1. Look for it in the "Ezequiel shortcuts" section on the right or just click HERE.

11/03/2015 - Updates to Maintenance plan deployment scripts available HERE

17/05/2015 - The SQL Swiss Army Knife Series Index
  • Blog do Ezequiel

    SQL Swiss Army Knife #2.1 - Scripting Logins - Updated


    EDIT (20-09-2012) - Added several scripting options; does not use SQL Server 2000 system tables anymore.
    EDIT (11-01-2013) - Fixed issue with permission syntax depending on version (2005 vs. 2008/2012).
    EDIT (18-03-2013) - Fixed issue with undeclared variable in cursor; Added options for access.

    Hello all,

    Here is another posting focusing on SQL scripts that may help on everyday DBA tasks, following the series "SQL Swiss Army Knife". This is another example of a script I've been using as a "local machine" bit of a wider DR strategy, in this case generating all logins and their respective server roles. Note that this does not deal with CERTIFICATE_MAPPED_LOGIN and ASYMMETRIC_KEY_MAPPED_LOGIN types.
    These are the options available:

    • All users:
      EXEC usp_logins
    • One user, All DBs:
      EXEC usp_logins '<User>'
    • One user, One DB:
      EXEC usp_logins '<User>', '<DBName>'
    • All users, One DB:
      EXEC usp_logins NULL, '<DBName>'
Page 1 of 1 (1 items)