title: How to delete old aspnet users with aspnet_Users_DeleteUser procedure?
body: <p>I am using the standard aspnet membership tables and I'm doing maintenance of our database.  We want to remove all the users that have not logged in for a year.  </p>
  
  <p>I know how to call the <code>aspnet_Users_DeleteUser</code> stored procedure in order to delete a single user, but how can I use it to delete all users where <code>aspnet_Users.LastActivityDate &lt; '1/1/2015'</code>?  </p>
  
  <p>I can write a SELECT statement to get out the usernames to delete, but how can I execute the procedure on each of them?  </p>