Blog do Ezequiel
Portuguese PFE SQL Server Team


June, 2010

Latest Updates
20/11/2014 - Latest update on the AdaptiveIndexDefrag procedure v1.6. Look for it in the "Ezequiel shortcuts" section on the right or just click HERE.

20/11/2014 - Updates to Maintenance plan deployment scripts available HERE

12/11/2014 - The SQL Swiss Army Knife Series Index
  • Blog do Ezequiel

    SQL Swiss Army Knife #2.1 - Scripting Logins - Updated

    • 0 Comments

    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)