How to replace sub string by stuff separated by stick | to separate values?

ahmed salah 3,216 Reputation points
2020-08-24T02:46:01.173+00:00

I work on SQL server 2012 I face issue I can't separate values by stick | using stuff ?

meaning i need to replace sub string by stuff

and what statement below do as sub string ,type.value and XML path

SELECT DISTINCT
[InputID],PART_ID,[Vendor ID],Manufacturer,[Digi-Key Part No.] ,[Mfr Part No.],[Description],Category,Family ,Obsolete ,[Non-Stock]
, [Part_Status],partNumber,CompanyName,DKFeatureName2,[Variant Number],IsUnit,
SUBSTRING((

SELECT isnull(StarFormat,'') + Value+ isnull(endFormat,'')
FROM #FinalTable
WHERE ([InputID] = Results.[InputID] and DkFeatureId = Results.DkFeatureId)
FOR XML PATH(''),TYPE).value('.', 'NVARCHAR(MAX)')
,1,5000) AS Value
FROM #FinalTable Results
where StatusId=3

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,053 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,575 questions
{count} votes

4 answers

Sort by: Most helpful
  1. m 4,271 Reputation points
    2020-08-24T07:59:32.463+00:00

    Hi @ahmed salah

    Could you please describe the issues and your expected result as this case: https://stackoverflow.com/questions/10581772/how-to-split-a-comma-separated-value-to-columns , https://stackoverflow.com/questions/5493510/turning-a-comma-separated-string-into-individual-rows?
    Could you please show your current table, and your expected table?

    BR,
    Mia
    If the reply is helped, please do “Accept Answer” .

    0 comments No comments

  2. m 4,271 Reputation points
    2020-08-25T01:23:44.65+00:00

    Hi @ahmed salah ,

    Any update?
    Is the issue solved?
    And if not could you please show your expected table and support us your sample data?

    BR,
    Mia
    If the reply is helped,please do "Accept Answer".--Mia

    0 comments No comments

  3. m 4,271 Reputation points
    2020-08-26T01:27:34.323+00:00

    Hi @ahmed salah ,

    Any update?
    Is the issue solved?
    And if not could you please show your expected table and support us your sample data?

    BR,
    Mia
    If the reply is helped,please do "Accept Answer".--Mia

    0 comments No comments

  4. m 4,271 Reputation points
    2020-08-28T01:33:45.897+00:00

    Hi @ahmed salah ,

    Any update?
    Is the issue solved?
    And if not could you please show your expected table and support us your sample data?

    BR,
    Mia
    If the reply is helped,please do "Accept Answer".--Mia

    0 comments No comments