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 |
infodemers
Posting Yak Master
183 Posts |
Posted - 2013-03-19 : 12:45:46
|
Is there an easy way to export to Excel, the list of all Application Users and roles from the database aspnetdb?Thanks! |
|
bandi
Master Smack Fu Yak Hacker
2242 Posts |
|
infodemers
Posting Yak Master
183 Posts |
Posted - 2013-03-21 : 11:03:37
|
Hi,I was not clear about my needs. My issue is not to export to excel. It is about getting the list. I finally managed it with the following code.use [aspnetdb]SELECT vw_aspnet_Roles.RoleName,vw_aspnet_Users.UserName,vw_aspnet_Users.LastActivityDateFROM vw_aspnet_Users INNER JOIN aspnet_Applications ON vw_aspnet_Users.ApplicationId = aspnet_Applications.ApplicationId INNER JOIN vw_aspnet_UsersInRoles ON vw_aspnet_Users.UserId = vw_aspnet_UsersInRoles.UserId INNER JOIN vw_aspnet_Roles ON vw_aspnet_UsersInRoles.RoleId = vw_aspnet_Roles.RoleIdWHERE (vw_aspnet_Users.UserName LIKE '%@%')ORDER BY vw_aspnet_Users.UserName, aspnet_Applications.ApplicationName,vw_aspnet_Roles.RoleName |
|
|
|
|
|