Logins without auser database mapping.

  • Hi All,

    Is there any method to find out Logins Which is not associated with Any user databases

    i have couple of logins which is jsut mapped to master db,not to any other Db

    is there any method to list it?

    Regards,

    Shine

  • Does the script you posted here (http://www.sqlservercentral.com/Forums/Topic581019-146-1.aspx) not work?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • You should be able to work this out with a little cursor (yack!) to execute and dump results for every DB on the server. Use this system stored proc like this:

    exec sp_change_users_login 'report'

    Execute and dump the result of each DB iteration on a temp table or print it and 'listo'.

  • hi,this is working but iam not sure the exact result is coming up.

  • shine.mm (10/6/2008)


    hi,this is working but iam not sure the exact result is coming up.

    When you run the stored proc on one of the DBs, what's the output you are getting?

  • hi,

    It shows error message,not avilable this SP

  • Hi,

    Did you copy and paste Miguel's query? If so there's a typo - it should be sp_change_users_login 'Report' the 'c' was missing from 'change'. That should work.

    Cath

  • Cath Trimble (10/7/2008)


    Hi,

    Did you copy and paste Miguel's query? If so there's a typo - it should be sp_change_users_login 'Report' the 'c' was missing from 'change'. That should work.

    Cath

    Good catch Cath! Thank you!

  • Try the attached script.

    RegardsRudy KomacsarSenior Database Administrator"Ave Caesar! - Morituri te salutamus."

  • Hopefully the attachment made it.

    RegardsRudy KomacsarSenior Database Administrator"Ave Caesar! - Morituri te salutamus."

Viewing 10 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic. Login to reply