I ended up doing something similar to the solution I referenced:
Listing 1:
CREATE FUNCTION dbo.GetUsersProfilePropertyByName
(
@UserID int,
@PortalID int,
@PropertyName nvarchar(50)
)
RETURNS nvarchar(50)
AS
BEGIN
DECLARE @DefinitionID int
SET @DefinitionID = (dbo.GetProfilePropertyDefinitionID(@PortalID, @PropertyName))
Declare @Value nvarchar(50)
Select @Value = (
Select Top 1 PropertyValue
FROM dbo.UserProfile
WHERE UserID = @UserID
AND PropertyDefinitionID = @DefinitionID
)
RETURN ISNULL(@Value, '')
END
Listing 2:
Create VIEW dbo.vw_Users_AF_Membership
AS
SELECT U.UserID, U.Username, dbo.GetUsersProfilePropertyByName(U.UserID, UP.PortalId, N'FirstName') AS FirstName,
dbo.GetUsersProfilePropertyByName(U.UserID, UP.PortalId, N'LastName') AS LastName, UP.PortalId, '' AS Location,
dbo.GetUsersProfilePropertyByName(U.UserID, UP.PortalId, N'WebSite') AS WebSite, 0 AS Posts, 0 AS UserDetailsID,
dbo.GetUsersProfilePropertyByName(U.UserID, UP.PortalId, N'City') AS City, dbo.GetUsersProfilePropertyByName(U.UserID, UP.PortalId, N'Region')
AS Region, dbo.GetUsersProfilePropertyByName(U.UserID, UP.PortalId, N'Country') AS Country, UP.PortalId AS ApplicationName, GETDATE()
AS LastActivityDate, GETDATE() AS CreateDate
FROM dbo.Users U INNER JOIN
dbo.UserPortals UP ON U.UserID = UP.UserId
WHERE (UP.PortalId = 0)
Which is then a 1 to 1 field matching with a users table I needed to populate in Active Forums earlier version module:
INSERT INTO dbo].[AF_Membership]
([UserID], [Username], [FirstName], [LastName], [PortalId], [Location], [WebSite], [Posts], [UserDetailsID], [City], [Region], [Country], [ApplicationName], [LastActivityDate], [CreateDate])
Select [UserID], [Username], [FirstName], [LastName], [PortalId],
[Location], [WebSite], [Posts], [UserDetailsID], City, Region,Country, [ApplicationName], [LastActivityDate], [CreateDate] FROM vw_Users_AF_Membership
WHERE UserID Not In (Select UserID FROM AF_Membership)
Keep in mind anyone wanting to use this solution, the view I created filters for portal id of 0. Otherwise, it should be pretty easy to modify this for other uses.