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.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2004-11-29 : 08:25:12
|
| Sudhakar writes "Hi team members,we have sp_databases for get all databases.Same as can we get all roles and role information in all databases ???or else any sp avail ???Thanking u.ByeSudhakar" |
|
|
hgorijal
Constraint Violating Yak Guru
277 Posts |
Posted - 2004-11-30 : 01:07:08
|
| [code]create table #temp (dB_name sysname, RoleName sysname, RoleId smallint, IsAppRole int)insert into #temp EXEC sp_MSforeachdb @command1='use ? select db_name(), name, uid, isapprole from sysusers where issqlrole = 1 or isapprole = 1'select * from #temp[/code]Note. sp_MSforeachdb is an undocumented feature and would not guarentee it would be future versions of SQL Server.Hemanth GorijalaExchange a Dollar, we still have ONE each._______Exchange an Idea, we both have TWO each. |
 |
|
|
|
|
|