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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:54:53+00:00 2026-06-03T08:54:53+00:00

I have searched many places and rarely use forums for posting… So I believe

  • 0

I have searched many places and rarely use forums for posting… So I believe I have a rare issue here. I have a csv file that contains a one to many relationship. In the form of say the first 10 fields contain the one record. This continues to a blank field and then within each additional field is another delimiter being a pipe that has fields within it. This is actually a log file of events that occured relating to a single call.

For example.

ID;MACHINEID;ANI;;COMMAND|ARGUMENTS|20120112.06:15:32

The bolded text can repeat many times or a few. This is the many side of the join on SQL. I need to get this back into SQL. I am thinking SSIS Script Block. Where I loop and add to the many table with the ID from the one side. Splitting the internal fields with the pipe as delimiter. I just wonder if anyone has seen this before and has a simple solution that maybe I don’t know about. I would imagine that this would have been better created in XML but alas that is not the case.

Any help is appreciated. I will even take criticism if it is mostly constructive. Thanks so much in advance.

To show table makeup

CREATE TABLE [dbo].[tblIVRCalls](
    [CALLID] [char](50) NOT NULL,
    [MACHINEID] [char](50) NOT NULL,
    [CHANNEL] [char](50) NOT NULL,
    [DNIS] [char](50) NOT NULL,
    [ANI] [char](50) NOT NULL,
    [STARTTIME] [smalldatetime] NOT NULL,
    [TRUNK] [char](50) NOT NULL,
    [APPLICATION] [char](50) NULL,
    [PLANID] [char](50) NULL,
    [DERIVEDID] [char](50) NULL,
    [TOTALTIME] [smalldatetime] NOT NULL,
 CONSTRAINT [PK_tblIVRCalls] PRIMARY KEY CLUSTERED 

CREATE TABLE [dbo].[IVRCallActions](
    [pk] [bigint] IDENTITY(1,1) NOT NULL,
    [fkCALLID] [char](50) NOT NULL,
    [SequenceNumber] [bigint] NOT NULL,
    [Command] [char](50) NOT NULL,
    [Arguments] [varchar](max) NOT NULL,
    [ExecutionTime] [datetime] NOT NULL,
 CONSTRAINT [PK_IVRCallActions] PRIMARY KEY CLUSTERED 
  • 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-03T08:54:55+00:00Added an answer on June 3, 2026 at 8:54 am

    Based upon the information found at SSIS Design Pattern: Loading Variable-Length Rows I was able to create the below procedure. The SSIS Script Block can do anything you can do with C# and can be installed to SQL Server to run at set intervals. Created 2 outputs for processing. You fill the Buffer for each one through this script. So one flat file in with one column. 2 outputs and this script in between.

        public override void Input0_ProcessInputRow(Input0Buffer Row)
        {
            IVRCallsBuffer.AddRow();
            string[] splitEntireRow = null;
            var byteRow = Row.Column0.GetBlobData(0,(int)Row.Column0.Length);
            var entireRow = System.Text.Encoding.ASCII.GetString(byteRow);
            splitEntireRow = entireRow.Split(';');
            int fieldPosition = 0;
            string CallID = "";
            while (splitEntireRow[fieldPosition] != "")
            {
                var splitIVRCall = splitEntireRow[fieldPosition].Split('=');
                switch (splitIVRCall[0])
                {
                    case "CALLID":
                        IVRCallsBuffer.CALLID = splitIVRCall[1];
                        CallID = splitIVRCall[1];
                        break;
                    case "MACHINEID":
                        IVRCallsBuffer.MACHINEID = splitIVRCall[1];
                        break;
                    case "CHANNEL":
                        IVRCallsBuffer.CHANNEL = splitIVRCall[1];
                        break;
                    case "DNIS":
                        IVRCallsBuffer.DNIS = splitIVRCall[1];
                        break;
                    case "ANI":
                        IVRCallsBuffer.ANI = splitIVRCall[1];
                        break;
                    case "STARTTIME":
                        IVRCallsBuffer.STARTTIME = DateTime.ParseExact(splitIVRCall[1], "yyyyMMdd.HH:mm:ss.fff", System.Globalization.CultureInfo.CurrentUICulture);
                        break;
                    case "TRUNK":
                        IVRCallsBuffer.TRUNK = splitIVRCall[1];
                        break;
                    case "APPLICATION":
                        IVRCallsBuffer.Application = splitIVRCall[1];
                        break;
                    case "PLANID":
                        IVRCallsBuffer.PLANID = splitIVRCall[1];
                        break;
                    case "DERIVEDID":
                        IVRCallsBuffer.DERIVEDID = splitIVRCall[1];
                        break;
                    case "TOTALTIME":
                        IVRCallsBuffer.TOTALTIME = DateTime.ParseExact(splitIVRCall[1],"mm:ss.fff",System.Globalization.CultureInfo.CurrentUICulture);
                        break;   
                }
                fieldPosition++;
            }
            fieldPosition++;
            uint sequence = 1;
            while (splitEntireRow.GetUpperBound(0) -1 > fieldPosition)
            {
                IVRCallActionsBuffer.AddRow();
                var splitIVRCallAction = splitEntireRow[fieldPosition].Split('|');
                IVRCallActionsBuffer.fkCALLID = CallID;
                IVRCallActionsBuffer.SequenceNumber = sequence;
                IVRCallActionsBuffer.Command = splitIVRCallAction[0];
                IVRCallActionsBuffer.Arguments = splitIVRCallAction[1];
                IVRCallActionsBuffer.ExecutionTime = DateTime.ParseExact(splitIVRCallAction[2],"yyyyMMdd.HH:mm:ss.fff", System.Globalization.CultureInfo.CurrentUICulture);
                fieldPosition++;
                sequence++;
            }
    
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to use bar chart in web application. I have searched many libraries
Yes, I have searched and tried many techniques, but nothing seems to work. Here
I realise this may be a duplicate, but I have searched through many forums
Ok, so I have searched in many places for the answer to this question,
I have searched many a page of Google results as well as here on
I have searched many places to add and display images dynamically on JPanel but
i have already searched many places many people have used ABAddressBookRef class but my
Does iPhone sdk supports route between two places on Map? I have searched many
First of all I have searched many times in this forum but none is
This is my fort post on stackoverflow. I have searched many similiar Q&A's on

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.