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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:14:12+00:00 2026-06-12T22:14:12+00:00

I have CSV values stored in string as: StringBuilder CSValue = new StringBuilder(); for

  • 0

I have CSV values stored in string as:

    StringBuilder CSValue = new StringBuilder();
    for (int i = 0; i < obj._contactNumbers.Count; i++)
    {
        CSValue.Append(obj._contactNumbers[i]);
        if (i != obj._contactNumbers.Count - 1)
        {
            CSValue.Append(",");
        }
    }

I have passed it to stored procedure (as CSValue.ToString()), now i have to pick each value and store it in cell. How should i seperate these values??

Please help me out!

  • 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-06-12T22:14:15+00:00Added an answer on June 12, 2026 at 10:14 pm

    you can try this one

    declare @Temp nvarchar(max), @c int, @a nvarchar(max)
    
    declare @Temp_Table table (value nvarchar(max))
    
    select @Temp = 'a,b,c,g,a'
    
    select @c = CHARINDEX(',', @Temp)
    while @c > 0
    begin
        insert into @Temp_Table
        select LEFT(@Temp, @c - 1)
    
        select @Temp = right(@Temp, LEN(@Temp) - @c)
        select @c = CHARINDEX(',', @Temp)
    end
    
    select * from @Temp_Table
    

    or you can write a table function to do this, if you need to do it often

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

Sidebar

Related Questions

I have a lot of large csv files with NULL values stored as ,,
I have a table named assignRole. I am passing string of userid (int) csv
I have a csv importroutine which imports my CSV values into Sitecore. After this
I have a class with a method called DataIn(int InputID, string CSVValue) , this
I have CSV text thats stored in the session array as csv. The lines
I have a SQL Server 2008 database. This database has a stored procedure that
I have CSV data (in fact the values are separated by a tab character,
I have a CSV file that has lists of values for some fields. They're
We have an stored procedure that we created so that user can write comma
We have an stored procedure that we created so that user can write comma

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.