Solved

sysusers & syslogins in R2?

Posted on 2010-11-16
12
1,448 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 300 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
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.

 
LVL 21

Assisted Solution

by:Jason Yousef, MS
Jason Yousef, MS earned 200 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 300 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 300 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 200 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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

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…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

776 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