Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 If exists

Author  Topic 

coolerbob
Aged Yak Warrior

841 Posts

Posted - 2005-06-30 : 05:27:15
What would be the "exists" check code (which system tables would I check) for sql2000 to see if the following exists?
a particular Role
a particular User
a particular Login

coolerbob
Aged Yak Warrior

841 Posts

Posted - 2005-06-30 : 05:32:25
nevermind, worked it out

master.dbo.syslogins
dbo.sysusers
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2005-06-30 : 07:33:07
There's also:

sp_helprole
sp_helpuser
sp_helplogins

The reason you should use these is that you should avoid direct system table queries whenever possible, since they will be locked down in future versions of SQL Server (like 2005).
Go to Top of Page
   

- Advertisement -