Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4616356
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:58:11+00:00 2026-05-22T01:58:11+00:00

Can anyone tell me what is wrong with this script: IF @MODE = ‘FRIEND-LIST-MANAGE’

  • 0

Can anyone tell me what is wrong with this script:

IF @MODE = 'FRIEND-LIST-MANAGE'
DECLARE @TotalPages INT
BEGIN
    SELECT @TotalPages = COUNT(*)/@PageSize
    FROM Member a
    INNER JOIN MemberConnection d ON d.ConnMemberID = a.MemberID
    WHERE d.MemberID = @MemberID;

    WITH FindMyFriends AS
    (
        SELECT ROW_NUMBER() OVER(sbuser.sf_DisplayName(a.MemberID) ASC) AS RowNum,
        a.MemberID,                                              -- 1
        a.UserName,                                              -- 2
        a.City,                                                  -- 3
        b.Abbr,                                                  -- 4
        b.State,                                                 -- 5
        c.Country,                                               -- 6 
        a.AvatarSm,                                              -- 7 
        a.AvatarMed,                                             -- 8 
        a.AvatarLg,                                              -- 9 
        sbuser.sf_MemberHasAudio(a.MemberID) AS HasAudio,        -- 10 
        sbuser.sf_MemberHasVideo(a.MemberID) AS HasVideo,        -- 11 
        sbuser.sf_MemberHasImages(a.MemberID) AS HasImages,      -- 12 
        sbuser.sf_DisplayName(a.MemberID) AS DisplayName,        -- 13 
        a.ProfileTypeID,                                         -- 14 
        a.LastLogin,                                             -- 15 
        a.CreateDate                                             -- 16 
        FROM Member a
        LEFT JOIN State b ON b.StateID = a.StateID
        INNER JOIN Country c ON c.CountryID = a.CountryID
        INNER JOIN MemberConnection d ON d.ConnMemberID = a.MemberID
        WHERE d.MemberID = @MemberID
    )
    SELECT * 
    FROM FindMyFriends
    WHERE RowNum BETWEEN (@PG - 1) * @PageSize AND @PG * @PageSize
    ORDER BY sbuser.sf_DisplayName(a.MemberID) ASC
END

SQL server reports:
Msg 102, Level 15, State 1, Procedure sp_memberConnection, Line 117
Incorrect syntax near ‘.’.

Any help would be greatly appreciated…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T01:58:12+00:00Added an answer on May 22, 2026 at 1:58 am

    ROW_NUMBER requires ORDER BY.

    Assuming sbuser.sf_DisplayName is a UDF I think you would need.

    ROW_NUMBER() OVER(ORDER BY sbuser.sf_DisplayName(a.MemberID) ASC)
    

    This seems like a potentially bad use of UDFs though as it will need to evaluate the UDF for each row in the source data. Can the UDF be replaced with a simple JOIN?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anyone please tell me what is wrong with this script. I am a
Can anyone tell me what I'm doing wrong in this jquery script? $(document).ready(function() {
Can anyone tell me what's wrong with this code? class Dataset < ActiveRecord::Base has_many
Can anyone tell me what's wrong with this code? It's giving me an error
Can anyone tell me what is wrong with this code? public abstract class BoardTestBean{
Can anyone tell me what's wrong with this robots.txt? http://bizup.cloudapp.net/robots.txt The following is the
Can anyone tell me what is going wrong with this code? I tried to
Can anyone tell me whats wrong with this code, im validating a form making
Can anyone tell me what's wrong with this piece of code? I can't seem
Can anyone tell me what is wrong with this code? I'm trying to determine

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.