question

debanikray avatar image
debanikray asked

Split column into rows with fixed length and valid pattern

We have a source data as below

ID|FDRT

1|FDR-1234-1234,FDR-12345-12345,FDR-123456-123456

2|FDR-12345-123456,FDR-12345677-12345678

The FDRT field is an ntext field so number of each such FDR values per ID is dynamic but comma separated. What we need is to split the ntext column to a max of 255 characters and with a valid FDR value(whose length is not fixed but comma separated) and transpose these columns per ID

We are in SQL Server environment.

splitcharacterscommantext
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.