I have a column ClientInformation
in a Table CurrentOrders
that contains a pipe delimited string:
5275=7147|109=62F36|5075=BCRM|12221=PortwareALGO1
each number=
is a FIX tag that I want to name as its own column and need to be able to use in a SELECT
statement and WHERE
clause.
I hacked something that let me identify rows i needed, but I can't use in SELECT
or WHERE
...
(LEFT (RIGHT(ClientInformation, ( LEN(ClientInformation) - (PATINDEX('%109=%',ClientInformation) + 3) )),
PATINDEX('%|%', RIGHT(ClientInformation, ( LEN(ClientInformation) - (PATINDEX('%109=%',ClientInformation) + 2) ))) -2))as AccountID
I am assuming i need to break each number=
out into its own temp column in my table, but I am having difficulty finding an explanation I can follow.
So, each of these values I would like as follows:
5275=7147|109=62F36|5075=BCRM|12221=PortwareALGO1
5275= as ClientBook
109= as AccountID
5075= as Broker ID
12221= as RouteTrace