Results 1 to 13 of 13

Thread: Doubt

  1. #1
    Join Date
    Jun 2002
    Posts
    8

    Angry Unanswered: Doubt

    I need know what is field equal suid from SQL 7.0 and not exist in
    SQL 2000.

  2. #2
    Join Date
    Dec 2002
    Posts
    9

    Thumbs up

    Use suid.

  3. #3
    Join Date
    Feb 2002
    Posts
    2,232
    What are you trying to do ?

  4. #4
    Join Date
    Dec 2002
    Posts
    9
    I wanna mean sid. That column exists in sql7.0 too, but the suid don´t exist in 2k now.

  5. #5
    Join Date
    Jun 2002
    Posts
    8

    Question In Select

    SELECT suid, name, dbname, Admin = sysadmin + serveradmin + setupadmin + processadmin + diskadmin + dbcreator
    FROM master..syslogins WHERE loginname = ' & vfdstrLoginID_App & '

    I want the the field equal suid.

  6. #6
    Join Date
    Oct 2002
    Posts
    369

    Post Re: Doubt

    There is not really much "doubt" about it, this is (or at least, has been) a fairly common issue upgrading 6.x systems; System table suid columns have been changed since 6.x (removed in 7.0 / 2k) in favor of sid columns:

    syslogins.suid --> syslogins.sid
    sysdatabases.suid --> sysdatabases.sid
    sysremotelogins.suid --> sysremotelogins.sid
    sysusers.suid --> sysusers.sid
    sysalternates.suid --> sysusers.isaliased
    sysalternates.altsuid --> sysusers.isaliased

    The related niladic functions also have changed: (the old ones are now "broken")
    SUSER_ID () --> SUSER_SID (), returns the user sid given the user name
    SUSER_NAME () --> SUSER_SNAME (), returns the user name given the sid

    The typical 6.x tsql involving suid columns, SUSER_NAME (), SUSER_ID (), etc., e.g.(to generate an informational result set of "user information" by joining syslogins and sysusers on suid) no longer will work in 7.0, and 2k. therefore, you may wish to consider replacing SUID references with SID references, for example:

    SELECT
    SUSER_SNAME(syslogins.sid) AS '"user name"',
    syslogins.loginname,
    syslogins.sid,
    syslogins.name,
    syslogins.dbname,
    syslogins.hasaccess,
    syslogins.bulkadmin,
    syslogins.dbcreator,
    syslogins.diskadmin
    FROM
    syslogins
    INNER JOIN
    sysusers
    ON
    syslogins.sid = sysusers.sid

  7. #7
    Join Date
    Oct 2002
    Posts
    369

    Re: Doubt


    There is not really much "doubt" about it, this is (or at least, has been) a fairly common issue upgrading 6.x systems; System table suid columns have been changed since 6.x (removed in 7.0 / 2k) in favor of sid columns:

    The typical 6.x tsql involving suid columns, SUSER_NAME (), SUSER_ID (), etc., e.g.(to generate an informational result set of "user information" by joining syslogins and sysusers on suid) no longer will work in 7.0, and 2k. therefore, you may wish to consider replacing SUID references with SID references, for example:
    For another example see: http://dbforums.com/t561459.html

  8. #8
    Join Date
    Jun 2002
    Posts
    8

    Not Realy

    syslogins.suid --> syslogins.sid
    Binary Hexadecimal

    Not is funcionaly in my programation? I want
    retorn a value binary, with is the suid ald what retorn
    the value sequential of numbers.

  9. #9
    Join Date
    Feb 2002
    Posts
    2,232
    Check out the following article:

    article

  10. #10
    Join Date
    Oct 2002
    Posts
    369
    An MSDN link on SUSER_ID: (may be helpful???)
    http://msdn.microsoft.com/library/de...u-sus_00mc.asp
    As stated in the link: "SUSER_SID returns a SUID only for a login that has an entry in the syslogins system table. In SQL Server 7.0, the security identification number (SID) replaces the server user identification number (SUID). SUSER_ID always returns NULL when used in Microsoft® SQL Server™ 2000."

  11. #11
    Join Date
    Jun 2002
    Posts
    8
    Okay.
    SELECT SUSER_ID ('sa') in SQL7.0
    ------
    1 -----> Binary
    (1 row(s) affected)

    SELECT SUSER_SID ('sa') in SQL2000
    ------
    NULL

    (1 row(s) affected)
    OR
    SELECT SUSER_SID('sa')
    ------
    0x01 ----- Hexa
    (1 row(s) affected)

    I want number sequential and binary per users, understand?

  12. #12
    Join Date
    Oct 2002
    Posts
    369

    Q1 I want number sequential and binary per users, understand?
    A1 Maybe, (for the most part suid columns were used in joins to return information). Apparently your requirement is different.

    Q1 Are you saying the application you are working with requires a 1s and 0s representation of Binary numbers? for example:

    User IntRep HexRep Binary
    Tom 10 0xA 1010
    sa 1 0x1 0001

    If you need to use the string '1010' for user Tom instead of 0xA, you could create a function or stored procedure to return 1010 (given a hex representation)?

  13. #13
    Join Date
    Feb 2002
    Posts
    2,232
    What are you trying to do (deja vu) ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •