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

  • Home
  • SEARCH
  • 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 3357284
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:36:52+00:00 2026-05-18T02:36:52+00:00

I have a stored procedure that returns many columns and is very cumbersome to

  • 0

I have a stored procedure that returns many columns and is very cumbersome to work with, I created another stored procedure that converts rows to columns. How do I insert the columns from the sub procedure into the main procedure?

I am think that were I want to put the columns from the sub procedure I code it like:

(select * from subprocedure where X= 1) as subquerycolumns

is this correct?

Here is my Table Function, however I am receiving a “The column prefix ‘IPAM_RIPS_SKILL-SET_PARTICIPANT_RATING_HDR” does not match with a table name or alias…” error, Everything looks fine to me though, can someone help me.

CREATE FUNCTION PARTICIPANTRATINGSET
(@PARTICIPANT_ID INT)
RETURNS TABLE
AS
RETURN
    SELECT 
        ST1.SKILL_SET_ID AS SET1, SS1.SET_NAME AS NAME1, ST1.SKILL_SET_RATING AS R1,
        ST2.SKILL_SET_ID AS SET2, SS2.SET_NAME AS NAME2, ST2.SKILL_SET_RATING AS R2,
        ST3.SKILL_SET_ID AS SET3, SS3.SET_NAME AS NAME3, ST3.SKILL_SET_RATING AS R3,
        ST4.SKILL_SET_ID AS SET4, SS4.SET_NAME AS NAME4, ST4.SKILL_SET_RATING AS R4,
        ST5.SKILL_SET_ID AS SET5, ST5.SKILL_SET_OPTIONAL AS NAME5, ST5.SKILL_SET_RATING AS R5,
        ST6.SKILL_SET_ID AS SET6, ST6.SKILL_SET_OPTIONAL AS NAME6, ST6.SKILL_SET_RATING AS R6,
        ST7.SKILL_SET_ID AS SET7, ST7.SKILL_SET_OPTIONAL AS NAME7, ST7.SKILL_SET_RATING AS R7,
        CM.COMMENTS
    FROM IPAM_RIPS_SKILL_SET_PARTICIPANT_RATING_HDR HT
    LEFT JOIN IPAM_RIPS_SKILL_SET_PARTICIPANT_RATING_DTL ST1
        ON HT.ID = ST1.HDR_ID and st1.SKILL_SET_ID = 1
    INNER JOIN IPAM_RIPS_SKILL_SETS SS1
        ON ST1.SKILL_SET_ID = SS1.ID
    LEFT JOIN IPAM_RIPS_SKILL_SET_PARTICIPANT_RATING_DTL ST2
        ON HT.ID = ST2.HDR_ID and st2.SKILL_SET_ID = 2
    INNER JOIN IPAM_RIPS_SKILL_SETS SS2
        ON ST2.SKILL_SET_ID = SS2.ID
    LEFT JOIN IPAM_RIPS_SKILL_SET_PARTICIPANT_RATING_DTL ST3
        ON HT.ID = ST3.HDR_ID and st3.SKILL_SET_ID = 3
    INNER JOIN IPAM_RIPS_SKILL_SETS SS3
        ON ST3.SKILL_SET_ID = SS3.ID
    LEFT JOIN IPAM_RIPS_SKILL_SET_PARTICIPANT_RATING_DTL ST4
        ON HT.ID = ST4.HDR_ID and st4.SKILL_SET_ID = 4
    INNER JOIN IPAM_RIPS_SKILL_SETS SS4
        ON ST4.SKILL_SET_ID = SS4.ID
    LEFT JOIN IPAM_RIPS_SKILL_SET_PARTICIPANT_RATING_DTL ST5
        ON HT.ID = ST5.HDR_ID and st5.SKILL_SET_ID = 5
    INNER JOIN IPAM_RIPS_SKILL_SETS SS5
        ON ST5.SKILL_SET_ID = SS5.ID
    LEFT JOIN IPAM_RIPS_SKILL_SET_PARTICIPANT_RATING_DTL ST6
        ON HT.ID = ST6.HDR_ID and st6.SKILL_SET_ID = 10
    INNER JOIN IPAM_RIPS_SKILL_SETS SS6
        ON ST6.SKILL_SET_ID = SS6.ID
    LEFT JOIN IPAM_RIPS_SKILL_SET_PARTICIPANT_RATING_DTL ST7
        ON HT.ID = ST7.HDR_ID and st7.SKILL_SET_ID = 11
    INNER JOIN IPAM_RIPS_SKILL_SETS SS7
        ON ST7.SKILL_SET_ID = SS7.ID
    INNER JOIN IPAM_RIPS_SKILL_SET_PARTICIPANT_RATING_COMMENTS CM
        ON HT.ID = CM.HDR_ID
    WHERE IPAM_RIPS_SKILL_SET_PARTICIPANT_RATING_HDR.PARTICIPANT_ID = @PARTICIPANT_ID
    GROUP BY PARTICIPANT_ID, ST1.SKILL_SET_ID, SS1.SET_NAME, ST1.SKILL_SET_RATING, ST2.SKILL_SET_ID, SS2.SET_NAME, ST2.SKILL_SET_RATING, ST3.SKILL_SET_ID, SS3.SET_NAME, ST3.SKILL_SET_RATING, ST4.SKILL_SET_ID, SS4.SET_NAME, ST4.SKILL_SET_RATING, ST5.SKILL_SET_ID, ST5.SKILL_SET_OPTIONAL, ST5.SKILL_SET_RATING, ST6.SKILL_SET_ID, ST6.SKILL_SET_OPTIONAL, ST6.SKILL_SET_RATING, ST7.SKILL_SET_ID, ST7.SKILL_SET_OPTIONAL, ST7.SKILL_SET_RATING, CM.COMMENTS
GO
  • 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-18T02:36:53+00:00Added an answer on May 18, 2026 at 2:36 am

    The table function did not work and was causing too many issue. I went with a view instead which worked jsut as good

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

Sidebar

Related Questions

I have a stored procedure that returns a result with 250!!! columns. But I
I have created a stored procedure GetNotifications that returns all notifications for a specific
We have a stored procedure that returns DB encrypted columns decrypted via DecryptByKeyAutoCert(). This
I have a stored procedure that returns three columns worth of data to our
I have a stored procedure that returns data in the format of: Date |
I have a MYSQL stored procedure SP1() that returns a result set. I want
I have the following iBatis mapping for an Oracle Stored Procedure that returns a
I have a stored procedure that takes no parameters, and it returns two fields.
Let's say I have a stored procedure in Microsoft SQL Server 2005 that returns
I have a function that returns a date from a stored procedure, and it

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.