Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

sysusers & syslogins in R2?

Posted on 2010-11-16
12
Medium Priority
?
1,516 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
ID: 34149275
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 1200 total points
ID: 34149789
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
ID: 34151769
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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 21

Assisted Solution

by:Jason Yousef, MS
Jason Yousef, MS earned 800 total points
ID: 34154980
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 1200 total points
ID: 34155657
>>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
ID: 34158125
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
 
LVL 6

Author Comment

by:anushahanna
ID: 34158156
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 1200 total points
ID: 34158333
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
ID: 34159205
>>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:Jason Yousef, MS
Jason Yousef, MS earned 800 total points
ID: 34160223
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
ID: 34160934
Thanks very much - that is a great idea.
0
 
LVL 21

Expert Comment

by:Jason Yousef, MS
ID: 34160943
I use VirtualBox  for virtual machines.
it's free from oracle..it's such a great product

http://www.virtualbox.org/
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

916 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