Description
Returns a count of records in the aspnet_PersonalizationAllUsers table with path names matching the specified pattern, or a count of records in the aspnet_PersonalizationPerUser table meeting several input criteria.
Parameters
| Name |
Type |
Direction |
| @Count |
int |
Input/Output |
| @AllUsersScope |
bit |
Input |
| @ApplicationName |
nvarchar |
Input |
| @Path |
nvarchar |
Input |
| @UserName |
nvarchar |
Input |
| @InactiveSinceDate |
datetime |
Input |
Definition
CREATE PROCEDURE dbo.aspnet_PersonalizationAdministration_GetCountOfState (
@Count int OUT,
@AllUsersScope bit,
@ApplicationName NVARCHAR(256),
@Path NVARCHAR(256) = NULL,
@UserName NVARCHAR(256) = NULL,
@InactiveSinceDate DATETIME = NULL)
AS
BEGIN
DECLARE @ApplicationId UNIQUEIDENTIFIER
EXEC dbo.aspnet_Personalization_GetApplicationId @ApplicationName, @ApplicationId OUTPUT
IF (@ApplicationId IS NULL)
SELECT @Count = 0
ELSE
IF (@AllUsersScope = 1)
SELECT @Count = COUNT(*)
FROM dbo.aspnet_PersonalizationAllUsers AllUsers, dbo.aspnet_Paths Paths
WHERE Paths.ApplicationId = @ApplicationId
AND AllUsers.PathId = Paths.PathId
AND (@Path IS NULL OR Paths.LoweredPath LIKE LOWER(@Path))
ELSE
SELECT @Count = COUNT(*)
FROM dbo.aspnet_PersonalizationPerUser PerUser, dbo.aspnet_Users Users, dbo.aspnet_Paths Paths
WHERE Paths.ApplicationId = @ApplicationId
AND PerUser.UserId = Users.UserId
AND PerUser.PathId = Paths.PathId
AND (@Path IS NULL OR Paths.LoweredPath LIKE LOWER(@Path))
AND (@UserName IS NULL OR Users.LoweredUserName LIKE LOWER(@UserName))
AND (@InactiveSinceDate IS NULL OR Users.LastActivityDate <= @InactiveSinceDate)
END
ASP.NET 2.0 Provider Database