Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2006
    Posts
    1

    Unanswered: Need Urgent Help developing a SQL script

    I am a new Sybase DBA, and was given a task to extract mismatched suid's in our Sybase Environment when dumps and loads occur.

    Can anyone provide me some logic or a working script to identify these id's and address them?

    Thanks,
    Robert

  2. #2
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    Code:
    -- print unmatched suid for same name
    select u.suid,u.name,l.suid,l.name
    from sysusers u 
    left join master..syslogins l 
      on l.name=u.name   
    where u.suid>1
     and (l.suid!=u.suid or l.suid is null)
    
    -- fix users suid with matching login name
    exec sp_configure 'update',1
    update sysusers set suid=l.suid 
    from sysusers u 
    join master..syslogins l 
      on l.name=u.name   
     and l.suid!=u.suid
    where u.suid>1
    exec sp_configure 'update',0
    Last edited by pdreyer; 10-20-06 at 04:58.

Posting Permissions

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