Ok I see where you have a mistake, don't use the alias d. for a column in split to table because you get this result for the generated code
cast(d.dbo.ClearWFElemAdv(DET_
you can do it like this : dbo.SplitToTable(CAST(dbo.ClearWFElemAdv(d.{DCNCOL:1173}) AS NVARCHAR(MAX)), ';') AS ST
Hi,
thank you for help and direction.
I don't know why, but "STRING_SPLIT" is not working ...
(did not recognize function ect. .. with declare I have got the same problem ... - maybe not set proper rights in database .. I don't know)
but dbo.SplitToTable works :D
any way in my scenario the proper code is:
[code="SQL"]
SELECT
a.DET_WFDID AS 'ID elementu',
{DCNCOL_NAME:1174} AS 'Kategoria',
ST.Item AS 'Punkt pytania'
FROM
WFElementDetails a
CROSS APPLY
dbo.SplitToTable(CAST({DCNCOL:1173} AS NVARCHAR(MAX)), ';') AS ST
WHERE
a.DET_WFDID = {WFD_WFDID}
and a.DET_WFCONID={WFCON:3749}
AND a.DET_IsDeleted = 0 -- Opcjonalnie, aby pominąć usunięte wiersze
[/Code]
and for Attribute in form (not Item list):
[code="SQL"]
SELECT
a.WFD_ID AS 'ID elementu',
ST.Item AS 'Punkt normy'
FROM
WFElements a
CROSS APPLY
dbo.SplitToTable(CAST('{3654}' AS NVARCHAR(MAX)), ';') AS ST
WHERE
a.WFD_ID = {WFD_ID}
[/Code]