Extract User-Role Mapping

  • Comments posted to this topic are about the item Extract User-Role Mapping

  • Versioning is too specific. You'll have to update this code everytime you apply a CU or SP. Why not just look at the first character? Show us how without the cursor, there must be a set-wise way to do this.

  • I receive this error:

    Msg 213, Level 16, State 7, Line 2

    Insert Error: Column name or number of supplied values does not match table definition.

    This does not look well...

    Greetz,
    Hans Brouwer

  • Hi Hans,

    I am not getting any error, I have executed it & there is no

  • Hi Hans,

    I am not getting "Insert Error: Column name or number of supplied values does not match table definition." Its working fine.

    Please try again & let me know if there it still give problem.

    Thanks

    Sudhir

  • Hi Sigal,

    Actually the only purpose to use cursor is to avoid DBO, SYS, INFORMATION_SCHEMA and Guest users, else we can directly execute sp_helpuser and it will return all user's role data.

    To avoid cursor, while creating #tmpuser table, we can add another field with identity column and then run a while loop.

    We have to run a loop to get roles of each user excluding system users.

    your comments are appreciated.

    Thanks

    Sudhir

Viewing 6 posts - 1 through 5 (of 5 total)

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