This project is read-only.

Membership DB on Azure

May 28, 2012 at 2:25 PM

 Deprecated feature 'Table hint without WITH' is not supported in this version of SQL Server

 It might be best of the Membership Database was scripted to support Azure.


Pat Tormey NH USA

May 28, 2012 at 2:44 PM

Hi Pat,

We currently don't support SQL Azure DBs.

Would you like to see that feature implemented?

If so, we can create a work item.


Kind Regards,


May 28, 2012 at 3:19 PM

You can just modify by adding the WITH Keyword

PROCEDURE [dbo].[aspnet_Membership_GetNumberOfUsersOnline]

@ApplicationName nvarchar(256),
@MinutesSinceLastInActive int, 
DECLARE @DateActive datetime 
ELECT @DateActive = DATEADD(minute, -(@MinutesSinceLastInActive), @CurrentTimeUtc)
DECLARE @NumOnline int
SELECT @NumOnline = COUNT(*)

FROM dbo.aspnet_Users u WITH (NOLOCK),

.aspnet_Applications a WITH (NOLOCK),

.aspnet_Membership m WITH (NOLOCK)

WHERE u.ApplicationId = a.ApplicationId
AND LastActivityDate> @DateActive
a.LoweredApplicationName = LOWER(@ApplicationName)
u.UserId = m.UserId



May 28, 2012 at 3:21 PM

I hear that Azure is a up and coming thing...(g)

This (WITH HINT) thing also applies to SQL 2012.

Maybe it would be a good idea to plan for it..


Thanks for your quick response



May 28, 2012 at 3:31 PM

Thank you!

I don't know what could be the best way to get clean and up-to-date scripts for ASP.NET Membership for SQL Server. The script on Nearforums is gotten from the .NET 2.0 Framework installation (%WINDIR%\Microsoft.NET\Framework\v2.0.50727\InstallMembership.sql)

Probably the best way is to re-export it from the database that is created with the SQL Azure Db db type selected...


I'll be glad to hear if you can find a better way :)

Kind Regards,


May 28, 2012 at 9:42 PM
Hi Jorge,
Yep, that's exactly what I did. But the only change was to use the keyword WITH
and that was only in the aspnet_Membership_GetNumberOfUsersOnline Stored proc
Maybe you could add it to the original script..
Meanwhile I'll look around for Azure options.. I know I've even seen one for Azue Tables..
Hey NICE product by the way.. Just started playing with it an I'm really impressed!
May 29, 2012 at 9:02 AM

Hi Pat,

Thanks for all the info! We will modify it.

If you ever want to join the Nearforums team we will be very glad to code with you!