aspnet_Membership_GetNumberOfUsersOnline
2006-08-30 09:17
218 查看
ALTER PROCEDURE dbo.aspnet_Membership_GetNumberOfUsersOnline --查询在线用户
@ApplicationName NVARCHAR(256),
@MinutesSinceLastInActive INT,
@TimeZoneAdjustment INT --显示新的本地时间而必须添加到 [通用协调时间](utc) 的分钟数。
AS
BEGIN
DECLARE @DateActive DATETIME --声明变量活动时间
SELECT @DateActive = DATEADD(minute, -(@MinutesSinceLastInActive + @TimeZoneAdjustment), GETDATE())
DECLARE @NumOnline INT --声明变量用户在线数
SELECT @NumOnline = COUNT(*)
FROM dbo.aspnet_Users u(NOLOCK),
dbo.aspnet_Applications a(NOLOCK),
dbo.aspnet_Membership m(NOLOCK)
WHERE u.ApplicationId = a.ApplicationId AND
LastActivityDate > @DateActive AND
a.LoweredApplicationName = LOWER(@ApplicationName) AND
u.UserId = m.UserId
RETURN(@NumOnline) --返回查询符合条件的在线数
END
@ApplicationName NVARCHAR(256),
@MinutesSinceLastInActive INT,
@TimeZoneAdjustment INT --显示新的本地时间而必须添加到 [通用协调时间](utc) 的分钟数。
AS
BEGIN
DECLARE @DateActive DATETIME --声明变量活动时间
SELECT @DateActive = DATEADD(minute, -(@MinutesSinceLastInActive + @TimeZoneAdjustment), GETDATE())
DECLARE @NumOnline INT --声明变量用户在线数
SELECT @NumOnline = COUNT(*)
FROM dbo.aspnet_Users u(NOLOCK),
dbo.aspnet_Applications a(NOLOCK),
dbo.aspnet_Membership m(NOLOCK)
WHERE u.ApplicationId = a.ApplicationId AND
LastActivityDate > @DateActive AND
a.LoweredApplicationName = LOWER(@ApplicationName) AND
u.UserId = m.UserId
RETURN(@NumOnline) --返回查询符合条件的在线数
END
相关文章推荐
- aspnet_Membership_GetAllUsers
- aspnet_Profile_GetNumberOfInactiveProfiles
- TSung, 单机用户提高用户的并发数(Improve maximum number of concurrent users in a single PC)
- 【网络编程】调用GetNumberOfInterfaces()函数获取本地计算机的网络接口数量
- Get nth Max number in an array of unsorted integers.
- Apache Tomcat哈希碰撞拒绝服务漏洞解决办法 or More than the maximum number of request parameters (GET plus POST)
- Sybase: get the list of users who have sa_role role
- Poi中getPhysicalNumberOfCells 与 getLastCellNum的差异
- PHP Record the number of login users
- 浅析getPhysicalNumberOfCells 和 getLastCellNum的区别
- poi中getPhysicalNumberOfRows()和getLastRowNum()区别
- aspnet_Membership_GetUserByEmail////aspnet_Membership_GetUserByName
- aspnet_UsersInRoles_GetRolesForUser
- POI中getPhysicalNumberOfCells 与 getLastCellNum的区别
- getPhysicalNumberOfCells 与 getLastCellNum的差异
- aspnet_Membership_GetUserByUserId
- aspnet_UsersInRoles_GetUsersInRoles
- hdu 4727 The Number Off of FFF 简单题( 2013 ACM/ICPC Asia Regional Online —— Warmup2 1012)
- poi 中获得行数 getLastRowNum() 和 getPhysicalNumberOfRows()
- Java开发Excel POI getPhysicalNumberOfCells 与 getLastCellNum的区别