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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Export to Excel, Application Users with Granted Ro
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Posting Yak Master

183 Posts

Posted - 03/19/2013 :  12:45:46  Show Profile  Reply with Quote
Is there an easy way to export to Excel, the list of all Application Users and roles from the database aspnetdb?


Flowing Fount of Yak Knowledge

2242 Posts

Posted - 03/20/2013 :  01:41:38  Show Profile  Reply with Quote
There are several methods:
1)Use Import/Export Wizard

Edited by - bandi on 03/20/2013 01:46:46
Go to Top of Page

Posting Yak Master

183 Posts

Posted - 03/21/2013 :  11:03:37  Show Profile  Reply with Quote

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.LastActivityDate
FROM 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.RoleId
WHERE (vw_aspnet_Users.UserName LIKE '%@%')
ORDER BY vw_aspnet_Users.UserName, aspnet_Applications.ApplicationName,vw_aspnet_Roles.RoleName
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.04 seconds. Powered By: Snitz Forums 2000