Solved

sysusers & syslogins in R2?

Posted on 2010-11-16
12
1,462 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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
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

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 Backup & Restore 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.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

821 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