December 29, 2008 at 7:01 pm
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
December 30, 2008 at 12:45 am
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
December 30, 2008 at 1:45 am
Kenneth, do you happen to know what it's called in 2005? Thanks.
December 30, 2008 at 1:57 am
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