Solved

sysusers & syslogins in R2?

Posted on 2010-11-16
12
1,437 Views
Last Modified: 2012-05-10
are these views still in R2 with the same columns as in 2000?
0
Comment
Question by:anushahanna
  • 6
  • 3
  • 3
12 Comments
 
LVL 6

Author Comment

by:anushahanna
Comment Utility
i could not find something like this for R2
http://msdn.microsoft.com/en-us/library/aa260592%28SQL.80%29.aspx

in other words, would
select * from sysusers bring back records in R2?
0
 
LVL 41

Accepted Solution

by:
ralmada earned 300 total points
Comment Utility
the view is sys.sysusers but it's supported for compatibility reasons.
http://msdn.microsoft.com/en-us/library/ms179871.aspx

you should use sys.database_principals, check the following link for a good 2000 to 2008 mapping reference
http://msdn.microsoft.com/en-us/library/ms187997.aspx
0
 
LVL 6

Author Comment

by:anushahanna
Comment Utility
OK- but plain sysusers itself will fail in R2..? how about 2008? if you have that version, could you please try it for me and let me know...
0
 
LVL 21

Assisted Solution

by:huslayer
huslayer earned 200 total points
Comment Utility
Yes, it's working fine in 2008
http://msdn.microsoft.com/en-us/library/ms179871(v=SQL.100).aspx

what you're trying to do? check for user names in different DBs?
0
 
LVL 41

Assisted Solution

by:ralmada
ralmada earned 300 total points
Comment Utility
>>but plain sysusers itself will fail in R2..?<<
Sorry I don't have it installed here. But, did you try with the prefix "sys." ? Remember that SQL 2008 R2 is not the same as SQL 2000, so things do not necessarily work the same on both.

0
 
LVL 6

Author Comment

by:anushahanna
Comment Utility
the reason i ask is i will be sending code to someone who has R2, just wanted to confirm if sysusers will work or complain in 2008 and R2..

0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 6

Author Comment

by:anushahanna
Comment Utility
in 2005,
both of the following are valid:

select * from dbo.sysusers
select * from sys.sysusers

how about 2008 & R2- does it have the 'dbo' ownership view?
0
 
LVL 41

Assisted Solution

by:ralmada
ralmada earned 300 total points
Comment Utility
Yes. the dbo still exists in 2008 and 2008 R2

Now like I said before you should refrain from using the sysusers view, specially if you are working in 2005 and 2008. So why don't you build your code with sys.database_principals rather than sysusers? ;)
0
 
LVL 6

Author Comment

by:anushahanna
Comment Utility
>>Yes. the dbo still exists in 2008 and 2008 R2
that's good to know- thanks for confirming it..

>>why don't you build your code with sys.database_principals rather than sysusers? ;)
Surely would like to, once we get rid of the 2000 environment- till then preferred to keep one query across all environments, when possible.. (not my choice)
0
 
LVL 21

Assisted Solution

by:huslayer
huslayer earned 200 total points
Comment Utility
yes dbo is there in 2008 and R2.
anushahanna: I use a virtual machine (VM) and install all the express editions or the developer editions on it, so I can test every edition during development. I recommend to do that for testing reasons.
0
 
LVL 6

Author Comment

by:anushahanna
Comment Utility
Thanks very much - that is a great idea.
0
 
LVL 21

Expert Comment

by:huslayer
Comment Utility
I use VirtualBox  for virtual machines.
it's free from oracle..it's such a great product

http://www.virtualbox.org/
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Join & Write a Comment

Suggested Solutions

Audit has been really one of the more interesting, most useful, yet difficult to maintain topics in the history of SQL Server. In earlier versions of SQL people had very few options for auditing in SQL Server. It typically meant using SQL Trace …
There have been several questions about Large Transaction Log Files in SQL Server 2008, and how to get rid of them when disk space has become critical. This article will explain how to disable full recovery and implement simple recovery that carries…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now