Concatenation Help

(imported topic written by nberger91)

I need help concatenating the following expressions, product version is causing my brain to ache.

The format I need is -

SQL Server (ITDS) ||
10.0.4321.0
||
C:\Program Files\Microsoft SQL Server\MSSQL10.ITDS\MSSQL\Binn\sqlservr.exe

SQL Server (TEST) || 10.50.1804.0 || C:\Program Files\Microsoft SQL Server\MSSQL10_50.TEST\MSSQL\Binn\sqlservr.exe

q:

(display names

of

services

whose

(display name

of

it

as

lowercase

contains

“SQL Server”

as

lowercase

AND

display name

of

it

as

lowercase

does not contain

“Integration”

as

lowercase

AND

display name

of

it

as

lowercase

does not contain

“Analysis Services”

as

lowercase

AND

display name

of

it

as

lowercase

does not contain

“Reporting Services”

as

lowercase

AND

display name

of

it

as

lowercase

does not contain

“Server Agent”

as

lowercase

AND

display name

of

it

as

lowercase

does not contain

“VSS Writer”

as

lowercase

AND

display name

of

it

as

lowercase

does not contain

“Server Browser”

as
lowercase ))

A:
SQL Server (ITDS)

A:
SQL Server (TEST)

A:
SQL Server (VCDB)

A:
SQL Server (VCDB5)

T:
0.532 ms

q:

product versions

of

files(((

if

exists

substring between

“%22”

of

it

then

substring between

“%22”

of

it

else

it
)

of

image paths

of

services

whose

(display name

of

it

as

lowercase

contains

“SQL Server”

as

lowercase

AND

display name

of

it

as

lowercase

does not contain

“Integration”

as

lowercase

AND

display name

of

it

as

lowercase

does not contain

“Analysis Services”

as

lowercase

AND

display name

of

it

as

lowercase

does not contain

“Reporting Services”

as

lowercase

AND

display name

of

it

as

lowercase

does not contain

“Server Agent”

as

lowercase

AND

display name

of

it

as

lowercase

does not contain

“VSS Writer”

as

lowercase

AND

display name

of

it

as

lowercase

does not contain

“Server Browser”

as
lowercase)))

A:
10.0.4321.0

A:
10.50.1804.0

A:
10.50.1804.0

A:
10.50.1790.0

T:
1.787 ms

q:

(((

if

exists

substring between

“%22”

of

it

then

substring between

“%22”

of

it

else

it
)

of

image paths

of

services

whose

(display name

of

it

as

lowercase

contains

“SQL Server”

as

lowercase

AND

display name

of

it

as

lowercase

does not contain

“Integration”

as

lowercase

AND

display name

of

it

as

lowercase

does not contain

“Analysis Services”

as

lowercase

AND

display name

of

it

as

lowercase

does not contain

“Reporting Services”

as

lowercase

AND

display name

of

it

as

lowercase

does not contain

“Server Agent”

as

lowercase

AND

display name

of

it

as

lowercase

does not contain

“VSS Writer”

as

lowercase

AND

display name

of

it

as

lowercase

does not contain

“Server Browser”

as
lowercase)))

A:
C:\Program Files\Microsoft SQL Server\MSSQL10.ITDS\MSSQL\Binn\sqlservr.exe

A:
C:\Program Files\Microsoft SQL Server\MSSQL10_50.TEST\MSSQL\Binn\sqlservr.exe

A:
C:\Program Files\Microsoft SQL Server\MSSQL10_50.VCDB\MSSQL\Binn\sqlservr.exe

A:
D:\Data\VCDB5\MSSQL10_50.VCDB5\MSSQL\Binn\sqlservr.exe

T:
68.244 ms

(imported comment written by jgstew)

The generic form for the answer is the following:

(it & " || " & it) of (“a”;“b”;“c”)

where (“a”;“b”;“c”) is a plural string, kind of like a plural service.

((display name of it) & " || " & ((it as string) of product versions of files((( if exists substring between “%22” of it then substring between “%22” of it else it) of image paths of it) & " || " & ((( if exists substring between “%22” of it then substring between “%22” of it else it) of image paths of it)) of services