Add a column in system table(SQL_LOGIN)

  • I need to add a pin for each user in SQL login table..

    Is there any way to add a column in SQL_LOGIN table.

    Any suggestion on this...

    Thanks

    Rohit

  • You can't modify the structure or content of the system tables.

  • Besides, sys.sql_logins, sys.server_principals and syslogins aren't tables. They're views. The underlying tables are hidden and aren't even queryable.

    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
  • Lynn and Gail, what would you say to creating a new table in a user database for holding the new data, along with the key fields from sys.sql_logins?



    Alvin Ramard
    Memphis PASS Chapter[/url]

    All my SSC forum answers come with a money back guarantee. If you didn't like the answer then I'll gladly refund what you paid for it.

    For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • Alvin Ramard (6/29/2009)


    Lynn and Gail, what would you say to creating a new table in a user database for holding the new data, along with the key fields from sys.sql_logins?

    Hmm, wonder I do, what is the purpose of such a request? Much information still needed from OP before an answer I can provide.

  • Lynn Pettis (6/29/2009)


    Alvin Ramard (6/29/2009)


    Lynn and Gail, what would you say to creating a new table in a user database for holding the new data, along with the key fields from sys.sql_logins?

    Hmm, wonder I do, what is the purpose of such a request? Much information still needed for OP before an answer I can provide.

    To wait, back in the tent, we go.



    Alvin Ramard
    Memphis PASS Chapter[/url]

    All my SSC forum answers come with a money back guarantee. If you didn't like the answer then I'll gladly refund what you paid for it.

    For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • Alvin Ramard (6/29/2009)


    Lynn and Gail, what would you say to creating a new table in a user database for holding the new data, along with the key fields from sys.sql_logins?

    It'd work. (I think, since I have no idea what the OP wants this for)

    Be an absolute pain to keep in sync if a login name gets changed, added, deleted. Since neither a foreign key nor a trigger can be added to the system tables, there's no automated way to propagate such changes.

    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
  • GilaMonster (6/29/2009)


    Alvin Ramard (6/29/2009)


    Lynn and Gail, what would you say to creating a new table in a user database for holding the new data, along with the key fields from sys.sql_logins?

    It'd work. (I think, since I have no idea what the OP wants this for)

    Be an absolute pain to keep in sync if a login name gets changed, added, deleted. Since neither a foreign key nor a trigger can be added to the system tables, there's no automated way to propagate such changes.

    Very good points Gail.



    Alvin Ramard
    Memphis PASS Chapter[/url]

    All my SSC forum answers come with a money back guarantee. If you didn't like the answer then I'll gladly refund what you paid for it.

    For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • saxena.rohit (6/29/2009)


    I need to add a pin for each user in SQL login table..

    Why not just accept "PINS" as the password?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Picking up on what Gail was saying about triggers on the relevant system objects, whilst you can't use a trigger, you could use the "Audit Login Change" event to detect login changes

  • Picking up on what Gail was saying about triggers on the relevant system objects, whilst you can't use a trigger, you could use the "Audit Login Change" event to detect login changes

Viewing 11 posts - 1 through 11 (of 11 total)

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