SYSXLOGINS --- In 2005

  • Hi All,

    I want to write a script which can work on both SQL 2000 and SQL 2005, the SQL 2000 Script is given below

    select @@servername,b.name,a.name

    from master.dbo.spt_values a, master.dbo.sysxlogins b

    where a.low = 0

    and a.type = 'SRV'

    and b.srvid IS NULL

    and a.number & b.xstatus = a.number

    As you know Sysxlogins is not present in SQL Server 2005.

    Please help.

    Thanks in Advance.

    Regards,

    Raj

  • Well, as you know, this is the thing when using systemtables.

    They often change between versions.

    I think your best bet would be to just write a 2005-version of your query, stick it in the same script and a version-checking query at the top to decide which variant the script should use depending on what server it's executed on.

    /Kenneth

  • Kenneth, do you happen to know what it's called in 2005? Thanks.

  • syslogins is still in 2005 (for backward compat reasons)

    Do a sp_helptext syslogins and you can see what it uses in 2005.

    There's a whole bunch of sys.* catalogviews available with different info in them,

    depending on exactly what one is after.

    /Kenneth

Viewing 4 posts - 1 through 3 (of 3 total)

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