Stored Procedure Icon dbo.forums_GetUserInfo

Stored Procedure Properties

Name Value
Owner dbo
Created 2004-05-31
Startup False
Encrypted False

Creation Options

Name Value
QUOTED_IDENTIFIER OFF
ANSI_NULLS OFF

Parameters

Name DataType Length Type
@UserName nvarchar 100 INPUT
@UpdateIsOnline bit 1 INPUT

Total: 2 parameter(s)

SQL

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO






CREATE                PROCEDURE forums_GetUserInfo
(
	@UserName nvarchar(50),
	@UpdateIsOnline bit
)
 AS
BEGIN

	IF @UpdateIsOnline = 1
		-- Update activity
		UPDATE 
			Users 
		SET 
			LastActivity = GetDate() 
		WHERE 
			Username = @UserName

        -- Get the user details
	SELECT
		Username,
		Password,
		Email,
		ForumView,
		Approved,
		ProfileApproved,
		Trusted,
		FakeEmail,
		URL,
		Signature,
		DateCreated,
		TrackYourPosts,
		LastLogin,
		LastActivity,
		TimeZone,
		Location,
		Occupation,
		Interests,
		MSN,
		Yahoo,
		AIM,
		ICQ,
		IsModerator = (select count(*) from moderators where username = @UserName),
		TotalPosts,
		HasAvatar,
		ShowUnreadTopicsOnly,
		Style,
		AvatarType,
		ShowAvatar,
		DateFormat,
		PostViewOrder,
		FlatView,
		AvatarUrl,
		Attributes
	FROM 
		Users (nolock)
	WHERE 
		UserName = @UserName

END


























GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO


					

Generated on 26/08/2004 15:05:32 by DataAide.