Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

sysusers & syslogins in R2?

Posted on 2010-11-16
12
Medium Priority
?
1,499 Views
Last Modified: 2012-05-10
are these views still in R2 with the same columns as in 2000?
0
Comment
Question by:anushahanna
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

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…
Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

704 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