Sorry if this question is very basic, but I just can't figure it out, and couldn't find any good answers.
I have a very long list of files, folders and Sizes. I need to Seperate the folders to columns, that I have a column for each folder.
I have a FilePath as a String (eg folder1\folder2\folder3). I want to seperate this into multiple Columns:
First | Second | Third | Fourth | ...
folder1 | folder2 | folder3 | NULL | ...
Foldera | folde rb | folderc | folderd |
using cross apply string_split(PATH,'\')as folder I get Folder1. using row_Number() I can define wich folder I have in my column, but it is always only 1 column.
Actual Example:
select [Parentpath], [Size], [spl].[value] from Files
cross apply string_split([ParentPath], '\') as [spl]
Parentpath || Size || Value
Business\Packets\Data\Archive || 29334 || Business