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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T02:17:53+00:00 2026-06-02T02:17:53+00:00

I have values like string a,b; a= 1,2,3,4; b=admin; I am passing a and

  • 0

I have values like

  string a,b;
  a= "1,2,3,4";
  b="admin";

I am passing a and b to SP and I want to save it in DB like

a   b
1  admin
2  admin
3  admin
4  admin

How can I do this? Can someone give me some ideas on how to do it?
Thank you..

  • 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-02T02:17:55+00:00Added an answer on June 2, 2026 at 2:17 am

    SQL doesn’t have a concept of arrays, so this gets a bit interesting.
    Pass a list as a string parameter:

    DECLARE @INSTR as VARCHAR(MAX)
    SET @INSTR = '2,3,177,'
    DECLARE @SEPERATOR as VARCHAR(1)
    DECLARE @SP INT
    DECLARE @VALUE VARCHAR(1000)
    SET @SEPERATOR = ','
    WHILE PATINDEX('%' + @SEPERATOR + '%', @INSTR ) <> 0 
    BEGIN
       SELECT  @SP = PATINDEX('%' + @SEPERATOR + '%',@INSTR)
       SELECT  @VALUE = LEFT(@INSTR , @SP - 1)
       SELECT  @INSTR = STUFF(@INSTR, 1, @SP, '')
       INSERT INTO myTable (a, b) VALUES (@VALUE, 'admin')
    END
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have simple form like this which accepts only two values string action and
I have csv values like this: $csv_data = test,this,thing hi,there,this is,cool,dude have,fun; I want
I have a String[] with values like so: public static final String[] VALUES =
I have a string like val1_val2,val3_val4 and I need to split these values to
I have double values which I would like to convert to String values with
I have a string like so: option_alpha=value option_beta=some other value option_gamma=X ...etc. I'm using
I have some values in a configuration file (XML file) with some values like
I have variables with values like 1.7m 1.8k and 1.2b how can I convert
How to convert hexadecimal value into emoji icons , I have a string like
I have a coded string that I'd like to retrieve a value from. I

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.