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 6476781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:52:03+00:00 2026-05-25T06:52:03+00:00

I have about thirty strings that get passed to my stored procedure which act

  • 0

I have about thirty strings that get passed to my stored procedure which act as the columns of a table I need to manipulate. Each string is delimited and I use a split function to break each one of these strings apart into it’s appropriate rows which usually consist of twenty or fewer rows. The split function is quite fast and return a table result with one column being an ID which is the primary key and the other column being the split out value, and from examining the execution plan the thirty splits only take up a fraction of my time. The part that seems to kill my performance is the actual join among those thirty split results sets.

DECLARE @WorkingTab TABLE ([ID] INT PRIMARY KEY, [Col1] VARCHAR(255), [Col2] VARCHAR(255), ...)

INSERT INTO @WorkingTab ([ID], [Col1], [Col2], ...)
SELECT
    splitStr1.ID,
    splitStr1.VALUE,
    splitStr2.VALUE,
    .
    .
    .
FROM
    dbo.Split(@Str1, '~') splitStr1
    LEFT JOIN
        dbo.Split(@Str2, '~') splitStr2
    ON splitStr1.ID = splitStr2.ID
    LEFT JOIN
        dbo.Split(@Str3, '~') splitStr3
    .
    .
    .

I’ve tried using inner joins instead of left join which decreased performance slightly. I’ve tried inserting just the first split result into an indexed temp table then updating the rest of the column values into the appropriate column in the temp table which again resulted in a minor performance decrease. I’ve tried tried inserting all of the results into a persistent table which also didn’t improve performance at all. If anyone has any suggestions on other ways to approach this or just general performance tips, I’m all ears. Thanks in advance.

  • 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-25T06:52:04+00:00Added an answer on May 25, 2026 at 6:52 am

    This is really not a good strategy, performance-wise. User defined functions will never be high performers. Have you considered submitting your data as an XML document and parsing it in a stored procedure? I’ve done that before and it’s usually a decent performer.

    In regards to your actual question, there may be some ability to optimize your table valued function so that it returns a table variable with a primary key defined, which could improve performance, but really, I recommend changing your upload strategy.

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

Sidebar

Related Questions

I have about 10million values that I need to put in some type of
I have about 10 drop down list controls that get populated. Instead of copying/pasting
I have about 20,000 records (coming from an SQLite db) that I need to
I am beginning a new web project that will have about thirty sites. Each
I have about 200 Excel files that are in standard Excel 2003 format. I
I have about 100 Word documents which include transliteration of foreign names. The author
I have generated a dataset that contains data spanning thirty days. Im trying to
I have about 5-6 Server Manager programs that write their own configuration file out
I have about 100 fields I need to make sure have non-empty values. To
I have about 8 gigs of music stored within Google Music, and I recently

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.